fixed 64-bit incompatibilities