Some cleanups, and streamline the login process a bit.