Endianess fixes