Fix reconnect handling