scripting fixes