Debugged indexing issues