Bugfix: handle the case of disconnecting an unconnected stream.