Fix for crashes in 64-bit OSes