diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index debff35..70b3aad 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -111,6 +111,7 @@
         self.port = port
         self.dbg_state = "init"
         self.logger = logging.getLogger("controller")
+        self.barrier_to = 15 # Barrier timeout default value; add to config
 
         # Transaction and message type waiting variables 
         #   xid_cv: Condition variable (semaphore) for packet waiters
@@ -161,7 +162,7 @@
                 self.parse_errors += 1
                 return
             if hdr.length == 0:
-                self.logger.info("Header length is zero")
+                self.logger.error("Header length is zero; out of sync")
                 self.parse_errors += 1
                 return
 
@@ -287,7 +288,8 @@
                 return False
 
             if len(pkt) == 0:
-                self.logger.warning("Zero-length switch read")
+                self.logger.warning("Zero-length switch read; closing cxn")
+                return True
 
             self._pkt_handle(pkt)
         else:
@@ -501,7 +503,7 @@
 
         return (msg, pkt)
 
-    def transact(self, msg, timeout=None, zero_xid=False):
+    def transact(self, msg, timeout=-1, zero_xid=False):
         """
         Run a message transaction with the switch
 
@@ -520,15 +522,19 @@
         if not zero_xid and msg.header.xid == 0:
             msg.header.xid = gen_xid()
 
+        if timeout == -1:
+            timeout = self.barrier_to
+        self.logger.debug("Running transaction %d" % msg.header.xid)
         self.xid_cv.acquire()
         if self.xid:
             self.xid_cv.release()
             self.logger.error("Can only run one transaction at a time")
-            return None
+            return (None, None)
 
         self.xid = msg.header.xid
         self.xid_response = None
         self.message_send(msg.pack())
+        self.logger.debug("Waiting for transaction %d" % msg.header.xid)
         self.xid_cv.wait(timeout)
         if self.xid_response:
             (resp, pkt) = self.xid_response
diff --git a/tests/basic.py b/tests/basic.py
index bf5798e..471fb2a 100644
--- a/tests/basic.py
+++ b/tests/basic.py
@@ -237,7 +237,7 @@
 
         rc = delete_all_flows(self.controller, basic_logger)
         self.assertEqual(rc, 0, "Failed to delete all flows")
-        do_barrier(self.controller)
+        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         for of_port in basic_port_map.keys():
             for pkt, pt in [
diff --git a/tests/caps.py b/tests/caps.py
index bb85818..4a0e355 100644
--- a/tests/caps.py
+++ b/tests/caps.py
@@ -90,7 +90,7 @@
     caps_logger.info("Inserting initial flow")
     rv = obj.controller.message_send(request)
     obj.assertTrue(rv != -1, "Error installing flow mod")
-    do_barrier(obj.controller)
+    self.assertEqual(do_barrier(obj.controller), 0, "Barrier failed")
     flow_count = 1
 
     caps_logger.info("Table idx: " + str(table_idx))
@@ -99,7 +99,7 @@
     while True:
         request.match.nw_src += 1
         rv = obj.controller.message_send(request)
-        do_barrier(obj.controller)
+        self.assertEqual(do_barrier(obj.controller), 0, "Barrier failed")
         flow_count += 1
         if flow_count % count_check == 0:
             response, pkt = obj.controller.transact(tstats, timeout=2)
diff --git a/tests/flow_expire.py b/tests/flow_expire.py
index 53d7181..1d05b6b 100644
--- a/tests/flow_expire.py
+++ b/tests/flow_expire.py
@@ -97,7 +97,7 @@
         fe_logger.info("Inserting flow")
         rv = self.controller.message_send(request)
         self.assertTrue(rv != -1, "Error installing flow mod")
-        do_barrier(self.controller)
+        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_FLOW_REMOVED,
                                                timeout=test_timeout)
diff --git a/tests/flow_stats.py b/tests/flow_stats.py
index 4d43672..a959102 100644
--- a/tests/flow_stats.py
+++ b/tests/flow_stats.py
@@ -171,7 +171,7 @@
         fs_logger.info("Inserting flow")
         rv = self.controller.message_send(flow_mod_msg)
         self.assertTrue(rv != -1, "Error installing flow mod")
-        do_barrier(self.controller)
+        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         # no packets sent, so zero packet count
         self.verifyStats(match, ofp.OFPP_NONE, test_timeout, 0)
@@ -298,7 +298,7 @@
         fs_logger.info("Inserting flow2")
         rv = self.controller.message_send(flow_mod_msg2)
         self.assertTrue(rv != -1, "Error installing flow mod")
-        do_barrier(self.controller)
+        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         num_pkt1s = random.randint(10,30)
         fs_logger.info("Sending " + str(num_pkt1s) + " pkt1s")
@@ -414,7 +414,7 @@
         fs_logger.info("Inserting flow2")
         rv = self.controller.message_send(flow_mod_msg2)
         self.assertTrue(rv != -1, "Error installing flow mod")
-        do_barrier(self.controller)
+        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
         num_pkt1s = random.randint(10,30)
         fs_logger.info("Sending " + str(num_pkt1s) + " pkt1s")
diff --git a/tests/pktact.py b/tests/pktact.py
index 724dcba..7b34d12 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -160,7 +160,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + 
                            str(ingress_port))
@@ -243,7 +243,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + 
                            str(ingress_port))
@@ -300,7 +300,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -355,7 +355,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -402,7 +402,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -454,7 +454,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -501,7 +501,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -553,7 +553,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -609,7 +609,7 @@
             pa_logger.info("Inserting flow")
             rv = self.controller.message_send(request)
             self.assertTrue(rv != -1, "Error installing flow mod")
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
             pa_logger.info("Sending packet to dp port " + str(ingress_port))
             pa_logger.info("No flood port is " + str(no_flood_port))
@@ -688,7 +688,7 @@
     def _ClearTable(self):
         rc = delete_all_flows(self.controller, self.logger)
         self.assertEqual(rc, 0, "Failed to delete all flows")
-        do_barrier(self.controller)
+        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     def runTest(self):
         
@@ -769,7 +769,7 @@
             # This *must* be set for DELETE
             msg.out_port = ofp.OFPP_NONE
             self.controller.message_send(msg)
-            do_barrier(self.controller)
+            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
         else:
             raise Exception("Not initialized")
 
@@ -1257,7 +1257,7 @@
         for f_idx in range(flow_count):
             rv = self.controller.message_send(flows[0][f_idx])
             self.assertTrue(rv != -1, "Error installing flow %d" % f_idx)
-        do_barrier(self.controller)
+        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
     
         pa_logger.info("Installed %d flows" % flow_count)
     
@@ -1279,7 +1279,8 @@
                     updates += 1
                     self.assertTrue(rv != -1, "Error modifying flow %d" % 
                                     f_idx)
-                do_barrier(self.controller)
+                self.assertEqual(do_barrier(self.controller), 0,
+                                 "Barrier failed")
 
         end = time.time()
         divisor = end - start or (end - start + 1)
diff --git a/tests/testutils.py b/tests/testutils.py
index f1459bf..9c7b81f 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -169,9 +169,16 @@
     return pkt
 
 def do_barrier(ctrl):
+    """
+    Do a barrier command
+    Return 0 on success, -1 on error
+    """
     b = message.barrier_request()
-    ctrl.transact(b)
-
+    (resp, pkt) = ctrl.transact(b, timeout=ctrl.barrier_to)
+    # We'll trust the transaction processing in the controller
+    if not resp:
+        return -1
+    return 0
 
 def port_config_get(controller, port_no, logger):
     """
@@ -475,12 +482,12 @@
         parent.logger.debug("Clear flow table")
         rc = delete_all_flows(parent.controller, parent.logger)
         parent.assertEqual(rc, 0, "Failed to delete all flows")
-        do_barrier(parent.controller)
+        parent.assertEqual(do_barrier(parent.controller), 0, "Barrier failed")
 
     parent.logger.debug("Insert flow")
     rv = parent.controller.message_send(request)
     parent.assertTrue(rv != -1, "Error installing flow mod")
-    do_barrier(parent.controller)
+    parent.assertEqual(do_barrier(parent.controller), 0, "Barrier failed")
 
 def flow_match_test_port_pair(parent, ing_port, egr_ports, wildcards=0, 
                               dl_vlan=-1, pkt=None, exp_pkt=None,
