Fix depth-first search (name shadowing).