unittest ad: corrected code for gradient, added hessian
unittest helpers: scaling