Fixing elf crash (indexing problem)