Because of possible cancellations, the most convincing test is to first zero out all terms except the Hartree terms in the energy and gradient before running the finite difference test. (Any easy way to do this is without much typing is to just multiply the unwanted terms temporarily by zero with ``*0''.) Once you have confirmed your Hartree terms, then turn all of the other terms back on and run the test again to make sure everything is turned on properly.