Add failed login handling. Closes #1.