Fix stringstream to ostream error