Tweaked a type conversion for 64-bit compatibility