Fix for zeroing stats after disconnect. Better logging and connection handling.