Index: trunk/BNC/src/bnccore.cpp
===================================================================
--- trunk/BNC/src/bnccore.cpp	(revision 10220)
+++ trunk/BNC/src/bnccore.cpp	(revision 10221)
@@ -123,6 +123,6 @@
 ////////////////////////////////////////////////////////////////////////////
 t_bncCore::~t_bncCore() {
-  delete _logStream;
-  delete _logFile;
+  delete _logStream; _logStream = 0;
+  delete _logFile;   _logFile   = 0;
   delete _ephStreamGPS;
   delete _ephFileGPS;
Index: trunk/BNC/src/bncgetthread.cpp
===================================================================
--- trunk/BNC/src/bncgetthread.cpp	(revision 10220)
+++ trunk/BNC/src/bncgetthread.cpp	(revision 10221)
@@ -476,6 +476,6 @@
         if (data.isEmpty() || BNC_CORE->sigintReceived) {
           emit(newMessage("No more data or Ctrl-C received", true));
+          BNC_CORE->stopPPP();
           BNC_CORE->stopCombination();
-          BNC_CORE->stopPPP();
           sleep(2);
           ::exit(5);
@@ -802,5 +802,5 @@
       // -----------------------
       for (int ii = 0; ii < decoder()->_obsList.size(); ii++) {
-        t_satObs& obs = decoder()->_obsList[ii]; 
+        t_satObs& obs = decoder()->_obsList[ii];
         QVector<QString>& rnxTypes = _rnxTypes[obs._prn.system()];
         bool allFound = true;
Index: trunk/BNC/src/bncmain.cpp
===================================================================
--- trunk/BNC/src/bncmain.cpp	(revision 10220)
+++ trunk/BNC/src/bncmain.cpp	(revision 10221)
@@ -569,4 +569,5 @@
     BNC_CORE->stopPPP();
     BNC_CORE->stopCombination();
+    sleep(2);
   }
   if (caster) {
Index: trunk/BNC/src/combination/bncbiassnx.cpp
===================================================================
--- trunk/BNC/src/combination/bncbiassnx.cpp	(revision 10220)
+++ trunk/BNC/src/combination/bncbiassnx.cpp	(revision 10221)
@@ -264,4 +264,5 @@
         if  (cb.contains("C1X") && cb.contains("C2X")) {cb.insert("C1X-C2X", cb["C1X"] - cb["C2X"]);}
         if  (cb.contains("C1X") && cb.contains("C5X")) {cb.insert("C1X-C5X", cb["C1X"] - cb["C5X"]);}
+        break;
       default:
         break;
@@ -271,9 +272,12 @@
 }
 
-// get DSBs from OSBs
+//
 ////////////////////////////////////////////////////////////////////////////
 t_irc bncBiasSnx::cleanDsb() {
-  for (auto itS = _snxSatCodeBiasMap.begin(); itS != _snxSatCodeBiasMap.end();){
-    if (!_useGnss[itS.key().at(0).toLatin1()]) {
+
+  for (auto itS = _snxSatCodeBiasMap.begin(); itS != _snxSatCodeBiasMap.end();) {
+    char sys = itS.key().at(0).toLatin1();
+    if (!_useGnss[sys]) {
+      delete itS.value();
       itS = _snxSatCodeBiasMap.erase(itS);
     }
Index: trunk/BNC/src/combination/bnccomb.cpp
===================================================================
--- trunk/BNC/src/combination/bnccomb.cpp	(revision 10220)
+++ trunk/BNC/src/combination/bnccomb.cpp	(revision 10221)
@@ -174,5 +174,5 @@
       newAC->name         = hlp[1];
       newAC->weightFactor = hlp[2].toDouble();
-      newAC->isAPC = (newAC->mountPoint.mid(0,4) =="SSRA");
+      newAC->isAPC = bool(newAC->mountPoint.mid(0,4) == "SSRA");
       QMapIterator<char, unsigned> itSys(_cmbSysPrn);
       // init
@@ -301,4 +301,5 @@
     _MAXRES = 999.0;
   }
+
 }
 
@@ -306,4 +307,5 @@
 ////////////////////////////////////////////////////////////////////////////
 bncComb::~bncComb() {
+
   QListIterator<cmbAC*> icAC(_ACs);
   while (icAC.hasNext()) {
@@ -315,6 +317,6 @@
   if (_ssrCorr) {
     delete _ssrCorr;
-
-  }
+  }
+
   delete _antex;
   delete _bsx;
@@ -1050,5 +1052,4 @@
     clkCorrections.push_back(clkCorr);
 
-
     ColumnVector xc(6);
     ColumnVector vv(3);
@@ -1062,5 +1063,4 @@
     // Correction Phase Center --> CoM
     // -------------------------------
-
     ColumnVector dx(3);   dx = 0.0;
     ColumnVector apc(3); apc = 0.0;
Index: trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 10220)
+++ trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 10221)
@@ -862,5 +862,5 @@
     }
     if (co.NumberOfSat[CLOCKORBIT_SATGLONASS] > 0) {
-      char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
+      char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
       if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
         co.UpdateInterval = ephUpdInd;
@@ -883,5 +883,5 @@
     }
     if (co.NumberOfSat[CLOCKORBIT_SATGALILEO] > 0) {
-      char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
+      char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
       if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
         co.UpdateInterval = ephUpdInd;
@@ -903,5 +903,5 @@
     }
     if (co.NumberOfSat[CLOCKORBIT_SATQZSS] > 0) {
-      char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
+      char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
       if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
         co.UpdateInterval = ephUpdInd;
@@ -922,5 +922,5 @@
     }
     if (co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0) {
-      char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
+      char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
       if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
         co.UpdateInterval = ephUpdInd;
@@ -940,5 +940,5 @@
     }
     if (co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
-      char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
+      char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
       if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
         co.UpdateInterval = ephUpdInd;
@@ -968,5 +968,5 @@
       || bias.NumberOfSat[CLOCKORBIT_SATSBAS] > 0
       || bias.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
-    char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
+    char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
     if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
       int len = _ssrCorr->MakeCodeBias(&bias, _ssrCorr->CBTYPE_AUTO, 0, obuffer, sizeof(obuffer));
@@ -987,5 +987,5 @@
       || phasebias.NumberOfSat[CLOCKORBIT_SATBDS] > 0)
       && (_phaseBiasInformationDecoded)) {
-    char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
+    char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
     if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
       int len = _ssrCorr->MakePhaseBias(&phasebias, _ssrCorr->PBTYPE_AUTO, 0, obuffer, sizeof(obuffer));
@@ -1000,5 +1000,5 @@
   QByteArray hlpBufferVtec;
   if (vtec.NumLayers > 0) {
-    char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
+    char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
     int len = _ssrCorr->MakeVTEC(&vtec, 0, obuffer, sizeof(obuffer));
     if (len > 0) {
Index: trunk/BNC/src/upload/bncuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 10220)
+++ trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 10221)
@@ -294,4 +294,7 @@
     msg = "SOURCE " + _password.toLatin1() + " /" + _mountpoint.toLatin1()
         + "\r\n" + "Source-Agent: NTRIP BNC/" BNCVERSION "\r\n\r\n";
+    _outSocket->write(msg);
+    _outSocket->waitForBytesWritten();
+    _outSocket->waitForReadyRead();
   } else {
     msg = "POST " + _postExtension.toLatin1() + "/" + _mountpoint.toLatin1()
@@ -301,8 +304,8 @@
         + "User-Agent: NTRIP BNC/" BNCVERSION " (" + BNC_OS + ")\r\n"
         + "Connection: close\r\n" + "Transfer-Encoding: chunked\r\n\r\n";
-  }
-  _outSocket->write(msg);
-  _outSocket->waitForBytesWritten();
-  _outSocket->waitForReadyRead();
+    _outSocket->write(msg);
+    _outSocket->waitForBytesWritten();
+    _outSocket->waitForReadyRead();
+  }
 
    QByteArray ans = _outSocket->readAll();
