     {missing, names, def, set} = where
     stillMissingNames = addAllTo dependencySet(),
       (name for name in (setToArray missing) when not inSet defined, name)
-    if stillMissingNames.numDependencies == 0 and set.numDependencies == 0
+    stillMissingDeps = removeAll (cloneSet set), setToArray hoistedNames
+    if stillMissingNames.numDependencies == 0 and stillMissingDeps.numDependencies == 0
       hoisted.push def
       addAllTo hoistedNames, names
     else

  reversedDependencies = reverseGraph graph
  independent = []

  moveToIndependent = (node) ->
    independent.push node
    delete dependencies[name] for name in node.names

        def: def
        names: names
        missing: stillMissingNames
        set: stillMissingDeps
  [hoisted, notHoisted]

addAllTo = (set, array) ->
