Make disconnecting work properly again.