32bit fixes and various other fixes