Fixing indexing issues.