Fixed #22724 -- Improve SingleObjectMixin.