Oops. This didn't work on infinite streams. Fixed that.