Update streaming.py

Patch to avoid reading stream incorrectly + safeguard to avoid crashing in case stream data format is genuinely wrong.