Indexing bug fix