Merged Volkers (correct) fix from 2.2 for crash on unable to connect.