DB/SAI: Fixed some runtime errors.