Index: /trunk/FACT++/src/biasctrl.cc
===================================================================
--- /trunk/FACT++/src/biasctrl.cc	(revision 12213)
+++ /trunk/FACT++/src/biasctrl.cc	(revision 12214)
@@ -152,5 +152,4 @@
         Error(str);
 
-        PostClose(false);
         return false;
     }
@@ -184,5 +183,6 @@
             {
                 ostringstream msg;
-                msg << "Corrupted answer (id=" << id << "): received wrap counter " << wrap << " doesn't match last received counter " << fWrapCounter << ".";
+                msg << "Corrupted answer (id=" << id << "): received wrap counter " << wrap << " doesn't match last one " << fWrapCounter << " ";
+                msg << " (fSendCounter=" << fSendCounter << ")";
                 Error(msg);
                 return false;
@@ -323,5 +323,8 @@
             (cmd==kCmdChannelSet    && !CheckMessageLength(bytes_received, 3*kNumChannels,   "CmdChannelSet"))   ||
             (cmd==kExpertChannelSet && !CheckMessageLength(bytes_received, 3,                "CmdExpertChannelSet")))
-            return;
+        {
+            CloseImp(false);
+            return;
+        }
 
         // Now evaluate the whole bunch of messages
@@ -330,5 +333,5 @@
             if (!EvalAnswer(buf.data(), i, command))
             {
-                PostClose(false);
+                CloseImp(false);
                 return;
             }
@@ -354,5 +357,5 @@
             msg << "Corrupted answer: received wrap counter " << fWrapCounter  << " is not send counter " << send_counter << "%8.";
             Error(msg);
-            PostClose(false);
+            CloseImp(false);
         }
 
@@ -441,5 +444,5 @@
                 Error(str);
             }
-            PostClose(false);//err!=ba::error::basic_errors::operation_aborted);
+            CloseImp(false);//err!=ba::error::basic_errors::operation_aborted);
             return;
         }
@@ -450,5 +453,5 @@
         {
             Error("Number of received bytes not a multiple of 3, can't read data.");
-            PostClose(false);
+            CloseImp(false);
             return;
         }
@@ -516,5 +519,5 @@
             Error(str);
 
-            PostClose(false);
+            CloseImp(false);
             return;
         }
@@ -537,5 +540,5 @@
             {
                 Error("Synchronization attempt timed out.");
-                PostClose(false);
+                CloseImp(false);
                 return;
             }
@@ -823,5 +826,7 @@
         if (volt<0 || volt>90)
         {
-            Error("ChannelSetVolt - Voltage out of range [0V,90V].");
+            ostringstream msg;
+            msg << "ChannelSetVolt - Given voltage " << volt << "V out of range [0V,90V].";
+            Error(msg);
             return false;
         }
@@ -867,5 +872,7 @@
             if (fVoltRef[ch]+dac[ch]>kMaxDac)
             {
-                Error("AddDac - New voltage reference out of range.");
+                ostringstream msg;
+                msg << "AddDac - New voltage reference " << fVoltRef[ch] << "+" << dac[ch] << " out of range [0," << kMaxDac << " for channel " << ch << ".";
+                Error(msg);
                 return false;
             }
@@ -891,5 +898,7 @@
             if (offset[ch]<-90 || offset[ch]>90)
             {
-                Error("AddVolt - Offset " << offset[ch] << " for channel " << ch << " out of range [-90V,90V].");
+                ostringstream msg;
+                msg << "AddVolt - Offset voltage " << offset[ch] << "V for channel " << ch << " out of range [-90V,90V].";
+                Error(msg);
                 return false;
             }
@@ -940,5 +949,7 @@
             if (volt[ch]<0 || volt[ch]>90)
             {
-                Error("SetVolt - Voltage out of range [0V,90V].");
+                ostringstream msg;
+                msg << "SetVolt - Voltage " << volt[ch] << "V out of range [0V,90V] for channel " << ch << ".";
+                Error(msg);
                 return false;
             }
@@ -966,5 +977,7 @@
         if (offset<-90 || offset>90)
         {
-            Error("SetGapdVoltage - Offset " << offset << " out of range [-90V,90V].");
+            ostringstream msg;
+            msg << "SetGapdVoltage - Offset voltage " << offset << "V out of range [-90V,90V].";
+            Error(msg);
             return false;
         }
@@ -975,5 +988,7 @@
             if (fVoltGapd[ch]+dac>kMaxDac)
             {
-                Error("SetGapdVoltage - New voltage reference out of range.");
+                ostringstream msg;
+                msg << "SetGapdVoltage - New voltage reference " << fVoltGapd[ch] << "+" << dac << " out of range [0," << kMaxDac << " for channel " << ch << ".";
+                Error(msg);
                 return false;
             }
@@ -1041,5 +1056,5 @@
         if (fIsRamping)
         {
-            Warn("RampStart - Ramping in progress... ignored.");
+            Warn("RampStart - Ramping already in progress... ignored.");
             return;
         }
@@ -1127,5 +1142,5 @@
         if (fGlobalVoltCmd>=0)
         {
-            Error("ExpertGlobalSetDac - Still waiting for previous global-set's answer.");
+            Error("ExpertGlobalSetDac - Still waiting for previous answer to 'GlobalSet'");
             return false;
         }
