Replacing Set::merge with Hash::merge