Fixed endianness bug