Fix spm script.