Remove nodes when disconnected.