Include primary groups in user and login filter when restricting group access and also fix user counting in primary groups