Fixes to indexing