Scripting fixes