Fixed bug in ScriptingManager