Fixed issue with mishandled connection errors.