Fix segfault in ELF parsing