Fix segmentation fault in ELF module