Removed unused code. Fixed register allocation.