Index: /trunk/FACT++/src/smartfact.cc
===================================================================
--- /trunk/FACT++/src/smartfact.cc	(revision 15080)
+++ /trunk/FACT++/src/smartfact.cc	(revision 15081)
@@ -394,4 +394,15 @@
 
             push_back(EventElement(t, s));
+        }
+
+        void clean()
+        {
+            for (auto it=begin(); it!=end();)
+                for (it=begin(); it!=end(); it++)
+                    if (!it->time)
+                    {
+                        erase(it);
+                        break;
+                    }
         }
 
@@ -726,5 +737,5 @@
         if (d.GetQoS()==MessageImp::kAlarm)
         {
-            if (d.GetSize()==1)
+            if (d.GetSize()<2)
                 for (auto it=fControlAlarmHist.begin(); it!=fControlAlarmHist.end(); it++)
                     it->time = Time(Time::none);
@@ -733,5 +744,5 @@
         }
 
-        if (d.GetQoS()==MessageImp::kComment)
+        if (d.GetQoS()==MessageImp::kComment && d.GetSize()>1)
             HandleControlMessageImp(d);
 
@@ -759,5 +770,5 @@
         // [1] DimControl::kLoading
         // [2] DimControl::kCompiling
-        // [3] DimControl::kRinning
+        // [3] DimControl::kRunning
         if (d.GetQoS()==1)
         {
@@ -2393,9 +2404,6 @@
 
         for (auto it=fControlAlarmHist.begin(); it!=fControlAlarmHist.end(); it++)
-        {
             newerr |= SetError(it->time.IsValid(), it->msg);
-            if (!it->time)
-                fControlAlarmHist.erase(it);
-        }
+        fControlAlarmHist.clean();;
 
         fLastRunFinishedWithZeroEvents = false;
