Fix opcodes, a few bugs, and initial linker script