Fixed stupid bug. Changed total_fox_derivative into fox_gradient.