Bugfixes for the ScriptEngine.