Fixes #419, Unhandled exception when logging in with an unprivileged user