win64 fixes (untested, yet)