fix up bit endianness