Fixed some bugs found adapting SbS to the GUI.