Fix bug where files with the same prefix as a directory would look like they were in that directory, but with their name chopped.