Added test + fix for base case, empty stream.