Fixes #9852 - inconsistent return value in OrderedSet