More robust termination conditioning

- Track total connections and disconnections for robust counting