Index: BreakingAlgorithm.java
===================================================================
--- BreakingAlgorithm.java	(revision 1143332)
+++ BreakingAlgorithm.java	(working copy)
@@ -1238,11 +1238,12 @@
         }
         node.next = null;
         if (activeLines[headIdx + 1] != null) {
-            activeLines[headIdx + 1].next = node;
+            node.previous = activeLines[headIdx + 1].previous;
+            activeNodeCount--;
         } else {
-            activeLines[headIdx] = node;
             endLine = line + 1;
         }
+        activeLines[headIdx] = node;
         activeLines[headIdx + 1] = node;
         activeNodeCount++;
     }
