Fix ref type