         srclines.push parseInt(g)
         ""
 
-    srclines = _.uniq srclines.sort(),true
+    srclines = _.sortBy(_.uniq(srclines), (i) -> i)
 
     text = rtrim(text)
+    indent = text.match /^\s*/
 
     if srclines.length > 0
-      minline = Math.min(srclines...)
+      minline = _.last(srclines)
 
       precomments = builder.comments_not_done_to(minline)
       if precomments
-        res.push precomments
+        res.push indent_lines indent,precomments
 
     if text
       if keep_line_numbers
-          text = text + "#" + srclines.join(",") + "  "
+          text = text + "#" +srclines.join(",") + "#  "
       res.push rtrim(text + " "+ltrim(builder.line_comments(srclines)))
+    else
+      res.push ""
 
   comments = builder.comments_not_done_to(1E10)
   if comments

      list = _.map n.children, (item) => @build item

      c = new Code @,n
      c.scope list.join("\n"),1,n #TODO
      c = "{#{c}}"  if options.brackets?
      @l(n)+c


#
# 2. This node is now passed onto `Builder#build()`.

indent_lines = (indent,lines) ->
  indent + lines.replace(/\n/g,"\n"+indent)

buildCoffee = (str, opts = {}) ->

  str  = str.replace /\r/g, ''
