Fix scripting errors