More fixes to stream detection