Index: /trunk/BNC/combination/bnccomb.cpp
===================================================================
--- /trunk/BNC/combination/bnccomb.cpp	(revision 3475)
+++ /trunk/BNC/combination/bnccomb.cpp	(revision 3476)
@@ -734,8 +734,6 @@
     ++iObs;
 
-    if (_method == filter) {
-      if (corr->acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {
-        resCorr[prn] = new t_corr(*corr);
-      }
+    if (corr->acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {
+      resCorr[prn] = new t_corr(*corr);
     }
 
@@ -785,43 +783,46 @@
                                         ColumnVector& dx) {
 
-  // Initialize resCorr
-  // ------------------
+  // Remove Satellites that are not in Master
+  // ----------------------------------------
+  QMutableVectorIterator<cmbCorr*> itCorr1(corrs());
+  while (itCorr1.hasNext()) {
+    cmbCorr* corr = itCorr1.next();
+    QString  prn  = corr->prn;
+    bool foundMaster = false;
+    QVectorIterator<cmbCorr*> it(corrs());
+    while (it.hasNext()) {
+      cmbCorr* corr2 = it.next();
+      QString  prn2  = corr2->prn;
+      QString  AC   = corr2->acName;
+      if (AC == _masterOrbitAC && prn == prn2) {
+        foundMaster = true;
+        break;
+      }
+    }
+    if (!foundMaster) {
+      itCorr1.remove();
+    }
+  }
+
+  // Count Number of Observations per Satellite and per AC
+  // -----------------------------------------------------
+  QMap<QString, int> numObsPrn;
+  QMap<QString, int> numObsAC;
   QVectorIterator<cmbCorr*> itCorr(corrs());
   while (itCorr.hasNext()) {
     cmbCorr* corr = itCorr.next();
     QString  prn  = corr->prn;
-    switchToLastEph(_eph[prn]->last, corr);
-    if (corr->acName == _masterOrbitAC && resCorr.find(prn) == resCorr.end()) {
-      resCorr[prn] = new t_corr(*corr);
-    }
-  }
-
-  // Count Number of Observations per Satellite and per AC
-  // -----------------------------------------------------
-  QMap<QString, int> numObsPrn;
-  QMap<QString, int> numObsAC;
-  QMapIterator<QString, t_corr*> itRes(resCorr);
-  while (itRes.hasNext()) {
-    itRes.next();
-    const QString& prnRes = itRes.key();
-    QVectorIterator<cmbCorr*> itCorr(corrs());
-    while (itCorr.hasNext()) {
-      cmbCorr* corr = itCorr.next();
-      QString  prn  = corr->prn;
-      QString  AC   = corr->acName;
-      if (prn == prnRes) {
-        if (numObsPrn.find(prn) == numObsPrn.end()) {
-          numObsPrn[prn]  = 1;
-        }
-        else {
-          numObsPrn[prn] += 1;
-        }
-        if (numObsAC.find(prn) == numObsAC.end()) {
-          numObsAC[AC]  = 1;
-        }
-        else {
-          numObsAC[AC] += 1;
-        }
-      }
+    QString  AC   = corr->acName;
+    if (numObsPrn.find(prn) == numObsPrn.end()) {
+      numObsPrn[prn]  = 1;
+    }
+    else {
+      numObsPrn[prn] += 1;
+    }
+    if (numObsAC.find(AC) == numObsAC.end()) {
+      numObsAC[AC]  = 1;
+    }
+    else {
+      numObsAC[AC] += 1;
     }
   }
@@ -843,5 +844,5 @@
     const QString& AC     = itAC.key();
     int            numObs = itAC.value();
-    if (numObs > 0) {
+    if (AC != _masterOrbitAC && numObs > 0) {
       _params.push_back(new cmbParam(cmbParam::offAC, ++nextPar, AC, ""));
     }
