Resurrect the forced-login support

Also did some cosmetical changes.

Fixes #953.