Fix mergeSelections in some cases