Fixed endianness bug in CTR