Script/SAI: Fix runtime errors