Fix unit tests.
Improve login dialog.