Minor optimizations to the computation of the force.