Fixes issue with sorting the index file