Fix ValueError in streams.py