Fix minor bugs in legacy compiler
Reuse parsed bytecode whenever possible
Fix opcode