fixes the windows-specific depth problems and recursion issues when doing list_dir on a root dev