Unwisely added more complicated client connection/disconnection code