     currentLine = renderedLines.firstChild
     screenRow = renderFrom
     for row in [renderFrom..renderTo]
-      if row == nextIntact?.to + 1
+      if row == nextIntact?.end + 1
         nextIntact = intactRanges.shift()
-      if !nextIntact or row < nextIntact.from
+      if !nextIntact or row < nextIntact.start
         lineElement = @buildLineElementForScreenRow(row)
         renderedLines.insertBefore(lineElement, currentLine)
       else

        while intactRange.domStart > domPosition
          currentLine = killLine(currentLine)
          domPosition++
        for i in [intactRange.from..intactRange.to]
          currentLine = currentLine.nextSibling
          domPosition++
      while currentLine

    i = 0
    while i < intactRanges.length
      range = intactRanges[i]
      if range.start < renderFrom
        range.domStart += renderFrom - range.start
        range.start = renderFrom
      if range.end > renderTo
        range.end = renderTo
      if range.start >= range.end
        intactRanges.splice(i--, 1)
      i++
    intactRanges.sort (a, b) -> a.domStart - b.domStart
