Additional test case and bug fix

Added test case for external transitions.
Fixed bugs: exiting regions, exiting pseudo state with external
transition, states as top-level state machine.