Adapted the scripting engine and made it compile.