Endianness and memory transfer fixes.