Documentation improvements, better error handling in login process