fix bug in computation of gravity torques