fix minor issues in stream.py