Fixes a bug where a directory with the same name as a file would be used as the matching entry instead of that file depending on the order they appear in the tarball.