fixes for endian garbage