Fix up globals: endianness, other fields of ref types.