Misc script engine changes