Function SeriesInfoInteger() is buggy

 
datetime first_date;
res  = CheckLoadHistory("AUDUSD", Period(), time[bar]);
SeriesInfoInteger("AUDUSD",Period(),SERIES_FIRSTDATE,first_date);

int CheckLoadHistory(string symbol,ENUM_TIMEFRAMES period,datetime start_date)
  {
     datetime first_date, linuxtimestart;

     linuxtimestart = D'1971.01.01';
     SeriesInfoInteger(symbol,Period(),SERIES_FIRSTDATE,first_date);   
     if(first_date>linuxtimestart && first_date<=start_date) return(1);
   
     if(SeriesInfoInteger(symbol,PERIOD_M1,SERIES_TERMINAL_FIRSTDATE,first_date)) // if this SeriesInfoInteger is removed the rest behaves properly
     {
        ... some jobs
     }
     return (-1);     
   }    
SeriesInfoInteger in main code and in CheckLoadHistory function returns two different values for same parameters.
Reason: