fixed handling of big-endian machines.