Small improvements to indexing