Tidy CompositeState.EndEnter and Region.EndEnter to remove casts