Fixing issue with registration disabled and invitations

This will fix an issue with certain combinations of registration and/or
invitations being enabled or disabled.

Addresses #330