Emit 'end' with error if on stream mode.
Include test for error handling on stream mode.
Tabulation on stream_spec.