Fix bugs in depthCheckingDirectoryWalk()