A general method for third-order bias and variance corrections on a nonlinear estimator