switch from std::ostream to raw ostream, fix file header.