I agree with you that it is a potentially latent bug...I supposed this could be fixed by just taking the maximum arity over all the productions.