some more scripting functions, some fixes