Fix reconnection bugs in counters and with sessions