added client autoreconnect, minor fixes