Fix portable endian code