Fixes for endianness