Fix run transition function generation