Optimize run.bat; Use string stream in template.cpp to prevent memory leakage.