Fix some bugs in the command /sp toggle