Lots of ELF fixes. Seems to be working.