Fix memberOf detection. Fixes: #9835

Proposed change.