Index: trunk/BNC/combination/bnccomb.cpp
===================================================================
--- trunk/BNC/combination/bnccomb.cpp	(revision 3501)
+++ trunk/BNC/combination/bnccomb.cpp	(revision 3502)
@@ -1002,14 +1002,24 @@
   const double MAX_DISPLACEMENT = 0.20;
 
-  //// beg test
+  // Switch to last ephemeris (if possible)
+  // --------------------------------------
   QMutableVectorIterator<cmbCorr*> im(corrs());
   while (im.hasNext()) {
     cmbCorr* corr = im.next();
-    if (!corr->eph) {
-      out << "checkOrbit: missing eph " << corr->prn << endl;
+    QString  prn  = corr->prn;
+    if (_eph.find(prn) == _eph.end()) {
+      out << "checkOrbit: missing eph (not found) " << corr->prn << endl;
       im.remove();
     }
-  }
-  //// end test
+    else {
+      if ( corr->eph == _eph[prn]->last || corr->eph == _eph[prn]->prev ) {
+        switchToLastEph(_eph[prn]->last, corr);
+      }
+      else {
+        out << "checkOrbit: missing eph (deleted) " << corr->prn << endl;
+        im.remove();
+      }
+    }
+  }
 
   while (true) {
@@ -1023,5 +1033,4 @@
       cmbCorr* corr = it.next();
       QString  prn  = corr->prn;
-      switchToLastEph(_eph[prn]->last, corr);
       if (meanRao.find(prn) == meanRao.end()) {
         meanRao[prn].ReSize(4);
