This fixes a double-free crash if lists are the same due to the two merge_ref() calls at the end of the (useless) merging that happens.