Scripting improvements