Fixed connection exception handling.