fixed some bugs relating to SPC things.