Too lazy to remember what I did. Couple of print things, couple of client-closed-connection prematurely stuff
Oh, I also added logging.