fixed big/little endian confusion bug.