Fixes to make SP work