Return correct entry when finding an index file