bug fix to hessian and fixed tests