Added better error handling on login and join outing.