Fix a bug in login.