Fixed a few bugs related to the 'Boss' state machine.