Added a monadic Counter and StreamState.