Fix login.

…and some PEP 8 stuff.