Index: /trunk/BNC/src/bncsp3.cpp
===================================================================
--- /trunk/BNC/src/bncsp3.cpp	(revision 9177)
+++ /trunk/BNC/src/bncsp3.cpp	(revision 9178)
@@ -18,4 +18,5 @@
 #include <iomanip>
 #include <sstream>
+#include <iostream>
 #include <math.h>
 
Index: /trunk/BNC/src/orbComp/sp3Comp.cpp
===================================================================
--- /trunk/BNC/src/orbComp/sp3Comp.cpp	(revision 9177)
+++ /trunk/BNC/src/orbComp/sp3Comp.cpp	(revision 9178)
@@ -84,5 +84,5 @@
   }
   if (!_log) {
-    cerr << "ERROR: SP3Comp requires logfile specification" << endl;
+    *_log  << "ERROR: SP3Comp requires logfile specification" << endl;
     goto exit;
   }
@@ -298,4 +298,5 @@
     map<t_prn, ColumnVector>& xyz  = epoch->_xyz;
     map<t_prn, ColumnVector>& xyz2 = epoch2->_xyz;
+    QList<t_prn> satEraseList;
     for (map<t_prn, ColumnVector>::const_iterator it = dr.begin(); it != dr.end(); it++) {
       const t_prn&  prn = it->first;
@@ -311,7 +312,10 @@
       }
       else {
-        epoch->_dc.erase(prn);
-        epoch->_dr.erase(prn);
-      }
+        satEraseList << it->first;
+      }
+    }
+    for (QList<t_prn>::const_iterator it = satEraseList.begin(); it != satEraseList.end(); it++) {
+      epoch->_dc.erase(*it);
+      epoch->_dr.erase(*it);
     }
   }
