fix some sp errors