Fix loose ends caused by change from Set::add to Set::replace