Dependency collection has to visit the instruction id first before evaluating the instruction, in order to completely any scopes that would end at that instruction. Note the removed dependencies that don't appear within the scopes.