Avoided double-reporting of connection closure/failure. Clarified docs and added tests.