Corrected StateMachines check box
Code restructuration
Bug fixes
Merge remote-tracking branch 'origin/master'