Properly make end of stream