fix little endian code