Try and fix some offset calculations.

May deal with the 32-bit issue, but something still seems amiss.