Fixing WalkDir function bugs.