Replace some std::string with wcstring to reduce copying