Boss Finite State Machine implementation.
Bug fixes