Correctly distinguish a directory