Fix memberOf detection. Fixes: #9835

Proposed change.
also here it would be more clear to write $groupProperties instead of $properties.