Fixed scripting functions