Make KeySet a Set, and make it work according to spec