Fix errors, and finish login.