Corrected a long standing bug in the gradient computations. Not a fatal bug, but it improves the accuracy slightly.

This stupid cut-and-paste bug has passed unnoticed for years, but it was found by one of my students. It's very nice to have such smart people actually check your code. After correcting it, I see that the results in my article from 2011 would have improved for a few cases where the error was still a bit too high for my liking.