Better handle login failures. Fixes #14