Fix indexing duplicates