Fix problems with 64-bit big-endian machines