o Properly handle login failures. Closes bug #3401.