Used a slightly better kludge for deciding whether to copy the pairs object if given.