Ensuring the stream is always reset.