Fixed various bugs (quite a few in register allocation)