Fixed hessian calculation.