Added State.onError and allowSelfTransition for transitions.