Index: branches/BNC_2.12/src/PPP_SSR_I/pppClient.cpp
===================================================================
--- branches/BNC_2.12/src/PPP_SSR_I/pppClient.cpp	(revision 8362)
+++ branches/BNC_2.12/src/PPP_SSR_I/pppClient.cpp	(revision 8370)
@@ -353,5 +353,4 @@
 //////////////////////////////////////////////////////////////////////////////
 void t_pppClient::putEphemeris(const t_eph* eph) {
-  bool check = _opt->_realTime;
   if (_newEph)
     delete _newEph;
@@ -375,5 +374,5 @@
 
   if (_newEph) {
-    _ephUser->putNewEph(_newEph, check);
+    _ephUser->putNewEph(_newEph, _opt->_realTime);
   }
 }
Index: branches/BNC_2.12/src/bncephuser.cpp
===================================================================
--- branches/BNC_2.12/src/bncephuser.cpp	(revision 8362)
+++ branches/BNC_2.12/src/bncephuser.cpp	(revision 8370)
@@ -83,5 +83,5 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncEphUser::slotNewGPSEph(t_ephGPS eph) {
-  putNewEph(&eph, false);
+  putNewEph(&eph, true);
 }
 
@@ -89,5 +89,5 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncEphUser::slotNewGlonassEph(t_ephGlo eph) {
-  putNewEph(&eph, false);
+  putNewEph(&eph, true);
 }
 
@@ -95,5 +95,5 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncEphUser::slotNewGalileoEph(t_ephGal eph) {
-  putNewEph(&eph, false);
+  putNewEph(&eph, true);
 }
 
@@ -101,5 +101,5 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncEphUser::slotNewSBASEph(t_ephSBAS eph) {
-  putNewEph(&eph, false);
+  putNewEph(&eph, true);
 }
 
@@ -107,10 +107,10 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncEphUser::slotNewBDSEph(t_ephBDS eph) {
-  putNewEph(&eph, false);
-}
-
-//
-////////////////////////////////////////////////////////////////////////////
-t_irc bncEphUser::putNewEph(t_eph* eph, bool check) {
+  putNewEph(&eph, true);
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
+t_irc bncEphUser::putNewEph(t_eph* eph, bool realTime) {
 
   QMutexLocker locker(&_mutex);
@@ -120,7 +120,6 @@
   }
 
-  if (check) {
-    checkEphemeris(eph);
-  }
+  checkEphemeris(eph, realTime);
+
 
   const t_ephGPS*     ephGPS     = dynamic_cast<const t_ephGPS*>(eph);
@@ -175,5 +174,5 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-void bncEphUser::checkEphemeris(t_eph* eph) {
+void bncEphUser::checkEphemeris(t_eph* eph, bool realTime) {
 
   if (!eph || eph->checkState() == t_eph::ok || eph->checkState() == t_eph::bad) {
@@ -207,38 +206,40 @@
   // Check whether the epoch is too far away the current time
   // --------------------------------------------------------
-  bncTime   toc = eph->TOC();
-  QDateTime now = currentDateAndTimeGPS();
-  bncTime currentTime(now.toString(Qt::ISODate).toStdString());
-  double timeDiff = fabs(toc - currentTime);
-
-  if      (eph->type() == t_eph::GPS     && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
-    eph->setCheckState(t_eph::outdated);
-    return;
-  }
-  else if (eph->type() == t_eph::Galileo && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
-    eph->setCheckState(t_eph::outdated);
-    return;
-  }
-  else if (eph->type() == t_eph::GLONASS && timeDiff > 1*3600) { // updated every 30 minutes
-    eph->setCheckState(t_eph::outdated);
-    return;
-  }
-  else if (eph->type() == t_eph::QZSS    && timeDiff > 4*3600) { // orbit parameters are valid for 7200 seconds (at minimum)
-    eph->setCheckState(t_eph::outdated);
-    return;
-  }
-  else if (eph->type() == t_eph::SBAS    && timeDiff > 600) { // maximum update interval: 300 sec
-    eph->setCheckState(t_eph::outdated);
-    return;
-  }
-  else if (eph->type() == t_eph::BDS     && timeDiff > 6*3600) { // updates (GEO) up to 6 hours
-    eph->setCheckState(t_eph::outdated);
-    return;
-  }
-  else if (eph->type() == t_eph::IRNSS   && timeDiff > 24*3600) { // update interval: up to 24 hours
-    eph->setCheckState(t_eph::outdated);
-    return;
-  }
-
+  if (realTime) {
+    bncTime   toc = eph->TOC();
+    QDateTime now = currentDateAndTimeGPS();
+    bncTime currentTime(now.toString(Qt::ISODate).toStdString());
+    double timeDiff = fabs(toc - currentTime);
+
+    if      (eph->type() == t_eph::GPS     && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
+      eph->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if (eph->type() == t_eph::Galileo && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
+      eph->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if (eph->type() == t_eph::GLONASS && timeDiff > 1*3600) { // updated every 30 minutes
+      eph->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if (eph->type() == t_eph::QZSS    && timeDiff > 4*3600) { // orbit parameters are valid for 7200 seconds (at minimum)
+      eph->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if (eph->type() == t_eph::SBAS    && timeDiff > 600) { // maximum update interval: 300 sec
+      eph->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if (eph->type() == t_eph::BDS     && timeDiff > 6*3600) { // updates (GEO) up to 6 hours
+      eph->setCheckState(t_eph::outdated);
+      return;
+    }
+    else if (eph->type() == t_eph::IRNSS   && timeDiff > 24*3600) { // update interval: up to 24 hours
+      eph->setCheckState(t_eph::outdated);
+      return;
+    }
+  }
+  
   // Check consistency with older ephemerides
   // ----------------------------------------
Index: branches/BNC_2.12/src/bncephuser.h
===================================================================
--- branches/BNC_2.12/src/bncephuser.h	(revision 8362)
+++ branches/BNC_2.12/src/bncephuser.h	(revision 8370)
@@ -74,5 +74,5 @@
 
  private:
-  void checkEphemeris(t_eph* eph);
+  void checkEphemeris(t_eph* eph, bool realTime);
   QMutex                             _mutex;
   static const unsigned              _maxQueueSize = 5;
Index: branches/BNC_2.12/src/ephemeris.cpp
===================================================================
--- branches/BNC_2.12/src/ephemeris.cpp	(revision 8362)
+++ branches/BNC_2.12/src/ephemeris.cpp	(revision 8370)
@@ -335,7 +335,12 @@
   double E  = M;
   double E_last;
+  int    nLoop = 0;
   do {
     E_last = E;
     E = M + _e*sin(E);
+    
+    if (++nLoop == 100) {
+      return failure;
+    }
   } while ( fabs(E-E_last)*a0 > 0.001 );
   double v      = 2.0*atan( sqrt( (1.0 + _e)/(1.0 - _e) )*tan( E/2 ) );
@@ -921,7 +926,12 @@
   double E  = M;
   double E_last;
+  int    nLoop = 0;
   do {
     E_last = E;
     E = M + _e*sin(E);
+
+    if (++nLoop == 100) {
+      return failure;
+    }
   } while ( fabs(E-E_last)*a0 > 0.001 );
   double v      = 2.0*atan( sqrt( (1.0 + _e)/(1.0 - _e) )*tan( E/2 ) );
Index: branches/BNC_2.12/src/rinex/reqcanalyze.cpp
===================================================================
--- branches/BNC_2.12/src/rinex/reqcanalyze.cpp	(revision 8362)
+++ branches/BNC_2.12/src/rinex/reqcanalyze.cpp	(revision 8370)
@@ -1054,5 +1054,5 @@
     for (unsigned ii = 0; ii < rnxNavFile.ephs().size(); ii++) {
       t_eph* eph = rnxNavFile.ephs()[ii];
-      ephUser.putNewEph(eph, true);
+      ephUser.putNewEph(eph, false);
       if (eph->checkState() == t_eph::bad) {
         ++numBad;
Index: branches/BNC_2.12/src/rinex/reqcedit.cpp
===================================================================
--- branches/BNC_2.12/src/rinex/reqcedit.cpp	(revision 8362)
+++ branches/BNC_2.12/src/rinex/reqcedit.cpp	(revision 8370)
@@ -642,4 +642,7 @@
       break;
     }
+    if (eph->checkState() != t_eph::bad) {
+      continue;
+    }    
     outNavFile.writeEph(eph);
   }
Index: branches/BNC_2.12/src/rinex/rnxnavfile.cpp
===================================================================
--- branches/BNC_2.12/src/rinex/rnxnavfile.cpp	(revision 8362)
+++ branches/BNC_2.12/src/rinex/rnxnavfile.cpp	(revision 8370)
@@ -210,12 +210,5 @@
       eph = new t_ephGPS(version(), lines);
     }
-    if (eph &&
-        eph->checkState() != t_eph::bad &&
-        eph->checkState() != t_eph::outdated) {
-      _ephs.push_back(eph);
-    }
-    else {
-      delete eph;
-    }
+    _ephs.push_back(eph);
   }
 }
