Fix hessian calculations