fix big endian mess by Darron