Fixed small bug of rewinding the stream