ILP64 fixes (untested)