Added Specification to Diagram feature and minor bug fixes in StateMachine