fixed a bug related to indexing where indexes may have been incorrectly assigned to certain names