Fixed login() when using wrong credentials