Correctly merges provided refs; fix