On second thought, handle bad connection state like any other write failure.
Fixed a goof where we were checking for a thing that would ALWAYS be null.
Minor inlining of some constants.