Fixed r selection in qf_merge