     files = []
 
     through (file, encoding, transformCallback) ->
-      # if vinyl objects have different properties, take first defined
+      # if vinyl objects have different properties, take first that exists
       source = (file[source] for source in sources).reduce (x, y) -> x ?= y
       source ?= file    # just look for title and order on the vinyl obj itself
       if source?.navSkip
         @push file
-        transformCallback()
-        return
+        return transformCallback()
       title = (source[title] for title in titles).reduce (x, y) -> x ?= y
       order = (source[order] for order in orders).reduce (x, y) -> x ?= y
       # insert new nav into the tree
-      nav = insertNavIntoTree file.relative, hrefExtension, title, order, root
+      nav = insertNavIntoTree file.relative, hrefExtension, title, order, rootPath
       # set properties of vinyl object XXX does this need error handling?
       for target in targets
         obj = file

    orders ?= 'order'
    hrefExtension ?= 'html'
    demoteTopIndex ?= no
    root ?= '/'               # XXX finish implementing this!
    # single options don't have to come wrapped in an Array
    sources = [ sources ] unless Array.isArray sources
    targets = [ targets ] unless Array.isArray targets

   orders
   hrefExtension
   demoteTopIndex
   rootPath
###

path = require 'path'
