Minor formatting and small fixes for login()