better handling of null streams