64-bit compatibility fixes