Index: /trunk/FACT++/src/fadctrl.cc
===================================================================
--- /trunk/FACT++/src/fadctrl.cc	(revision 11013)
+++ /trunk/FACT++/src/fadctrl.cc	(revision 11014)
@@ -563,5 +563,5 @@
     bool Check(const uint32_t *dat, uint32_t maxaddr, uint32_t maxval)
     {
-        if (dat[0]>FAD::kMaxRegAddr)
+        if (dat[0]>maxaddr)
         {
             ostringstream msg;
@@ -571,5 +571,5 @@
         }
 
-        if (dat[1]>FAD::kMaxRegValue)
+        if (dat[1]>maxval)
         {
             ostringstream msg;
@@ -603,13 +603,15 @@
             return T::kSM_FatalError;
 
-        // ---- was uint32_t
         const int32_t *dat = evt.Ptr<int32_t>();
 
-        // ---- -1 for all
-        //if (!Check(dat, FAD::kMaxRoiAddr, FAD::kMaxRoiValue))
-        //            return T::GetCurrentState();
-
         for (BoardList::iterator i=fBoards.begin(); i!=fBoards.end(); i++)
-            i->second.second->CmdSetRoi(dat[0], dat[1]);
+            if (!i->second.second->CmdSetRoi(dat[0], dat[1]))
+            {
+                ostringstream msg;
+                msg << hex << "Channel " << dat[0] << " or Value " << dat[1] << " out of range.";
+                T::Error(msg);
+                return false;
+            }
+
 
         return T::GetCurrentState();
@@ -835,5 +837,5 @@
         }
 
-        T::Out() << "Thread :";
+        T::Out() << "Event builder thread:";
         if (!IsThreadRunning())
             T::Out() << " not";
@@ -1027,5 +1029,5 @@
 public:
     StateMachineFAD(ostream &out=cout) :
-        T(out, "FAD_CONTROL"), EventBuilderWrapper(static_cast<MessageImp&>(*this)), ba::io_service::work(static_cast<ba::io_service&>(*this)),
+        T(out, "FAD_CONTROL"), EventBuilderWrapper(*static_cast<MessageImp*>(this)), ba::io_service::work(static_cast<ba::io_service&>(*this)),
         fStatus1(40), fStatus2(40),
         fDimConnection("FAD_CONTROL/CONNECTIONS", "C:41", "")
