Fix issue with double indexing