Changed fmin_ncg call to fmin_tnc.