Modified a bug in the torque calculation.