      found = false
      while n < t
       m = @mainNodes[n]
+      ++n
+      continue unless m?
       s = @sidenoteMap[m]
-      ++n
-      @pageNumbers.push
-       page: pageNo
-       node: @map.nodes[m]
       continue unless s?
       found = true
 

      n = i
      pageNo++

    setPageFill: (f, t, pos, emptyPages, pageNo) ->
     margin = (f > START)
     first = true


      i = @mainNodes.length unless i?
      found = @setPageFill n, i, pos, emptyPages, pageNo
      @collectPageNumbers n, i, pageNo
      if not found
       emptyPages.push pos: pos, f: n
      else
