Changes to support big endian platforms.