Fix some stream bugs