Merge "Refactor the way we handle directories in traverse."