A bunch of fixes that should mean that it now works correctly for everything except cross-boundry with negative numbers which is an emulator error
I believe.