Fixed doLogin (again) and doSendMessage