TMinuit in a stand-alone c++ program

I’m using TMinuit class in a stand alone program, w/o using TFitter ( or anything that inherits from TVirtualFitter)

I got the following issue:

TMinuit *a = new TMinuit(npars);
// ... set the FCN, fitting parameters, initial values etc

This seems to have no effect
always stays at 545
a->fMaxIterations does change.

this is problematic because I get sometimes
a->fCstatu = “CALL LIMIT” due to
a->fNfcn being much larger
than a->fNfcnmx

Then I looked at the code for a->Migrad() (TMinuit.cxx) :

Int_t TMinuit::Migrad()
// invokes the MIGRAD minimizer
   Int_t err;
   Double_t tmp = 0;

   mnexcm( "MIGRAD", &tmp, 0, err );

   return err;

If I run MIGRAD differently:

Double_t arglist[1] = {100000.0};
Int_t err = 0;

then the fitter converges ok and checking
a->fNfcnmx gives 100000, as I would expect.

Could it be a bug in TMinuit::Migrad()? Maybe it should do something like

// ....
Int_t TMinuit::Migrad()
   Int_t err;
   Double_t tmp = (double)fMaxIterations ;
   mnexcm( "MIGRAD", &tmp, 1, err );
   return err;

Thank you,