improvements and fixes around peer time-out, automatic reconnect and disconnect