fix the handling of alternatives with different number of nodes