Fixed a bug that led to an access violation when orthogonal region 0 of a state was terminated before exiting the state (either through another termination or a transition).