Fixes an indexing error when ID file gets too big