various fixes and addition of TransitionToWhenThen