Make clienthelper set socket waiting for read event and other bugfixes