fixed computation of gradients
fixed computation of gradients

chrisengelsma/jtk,voltnor/jtk,askogvold/jtk,voltnor/jtk,chrisengelsma/jtk,MinesJTK/jtk,MinesJTK/jtk,askogvold/jtk,chrisengelsma/jtk,dhale/jtk,askogvold/jtk,ctrueden/jtk,ctrueden/jtk,ctrueden/jtk,MinesJTK/jtk,ctrueden/jtk,voltnor/jtk,dhale/jtk,voltnor/jtk,dhale/jtk,askogvold/jtk