Error handling for login, more tests