ScriptGen.cpp fix