Fixed indexing for debugging