Filter on profile, not on user.

Apparently no units were returned in some scenarios when filtering on
User objects.

Fixes bug 2774.