Fix all segfaults spotted by my fuzzing tests on MACH0