Bug in improper class2?

I have been working with lammps using class2 potential and I have found what i think is a bug in the code. In the improper part of the potential (improper_class2.cpp – line 716) the code says:

    dthABC = thetaABC - aa_theta0_1[type];
    dthCBD = thetaCBD - aa_theta0_2[type];
    dthABD = thetaABD – aa_theta0_3[type];

But I think it should be:

    dthABC = thetaABC - aa_theta0_1[type];
    dthCBD = thetaCBD - aa_theta0_3[type];
    dthABD = thetaABD – aa_theta0_2[type];

Is this right?

It's been a long time since I looked at the details of
the class 2 potentials. I will say that these were validated
carefully against the Acclerys code (Discover at the time),
meaning energies and forces matched to high precision.
So unless this term is neglible, I'd be surprised if it is in
error. What is your logic/math for why this is not correct?