diff --git a/tests-1.4/bundle.py b/tests-1.4/bundle.py
index b1251bc..1ff1eba 100644
--- a/tests-1.4/bundle.py
+++ b/tests-1.4/bundle.py
@@ -9,7 +9,6 @@
 from oftest import config
 import oftest.base_tests as base_tests
 import ofp
-import loxi.of14 as of14
 
 from oftest.testutils import *
 
@@ -18,17 +17,17 @@
     Verify that messages added to a bundle are executed only after a commit
     """
     def runTest(self):
-        request = of14.message.bundle_ctrl_msg(
-            bundle_ctrl_type=of14.OFPBCT_OPEN_REQUEST,
+        request = ofp.message.bundle_ctrl_msg(
+            bundle_ctrl_type=ofp.OFPBCT_OPEN_REQUEST,
             bundle_id=1)
 
         response, _ = self.controller.transact(request)
-        self.assertIsInstance(response, of14.message.bundle_ctrl_msg)
-        self.assertEqual(response.bundle_ctrl_type, of14.OFPBCT_OPEN_REPLY)
+        self.assertIsInstance(response, ofp.message.bundle_ctrl_msg)
+        self.assertEqual(response.bundle_ctrl_type, ofp.OFPBCT_OPEN_REPLY)
         self.assertEqual(response.bundle_id, 1)
 
         for i in xrange(0, 10):
-            request = of14.message.bundle_add_msg(
+            request = ofp.message.bundle_add_msg(
                 xid=i,
                 bundle_id=1,
                 data=ofp.message.echo_request(xid=i).pack())
@@ -38,13 +37,13 @@
         msg, _ = self.controller.poll(ofp.message.echo_reply)
         self.assertIsNone(msg)
 
-        request = of14.message.bundle_ctrl_msg(
-            bundle_ctrl_type=of14.OFPBCT_COMMIT_REQUEST,
+        request = ofp.message.bundle_ctrl_msg(
+            bundle_ctrl_type=ofp.OFPBCT_COMMIT_REQUEST,
             bundle_id=1)
 
         response, _ = self.controller.transact(request)
-        self.assertIsInstance(response, of14.message.bundle_ctrl_msg)
-        self.assertEqual(response.bundle_ctrl_type, of14.OFPBCT_COMMIT_REPLY)
+        self.assertIsInstance(response, ofp.message.bundle_ctrl_msg)
+        self.assertEqual(response.bundle_ctrl_type, ofp.OFPBCT_COMMIT_REPLY)
         self.assertEqual(response.bundle_id, 1)
 
         for i in xrange(0, 10):
@@ -57,17 +56,17 @@
     Verify that messages in a discarded bundle are not executed
     """
     def runTest(self):
-        request = of14.message.bundle_ctrl_msg(
-            bundle_ctrl_type=of14.OFPBCT_OPEN_REQUEST,
+        request = ofp.message.bundle_ctrl_msg(
+            bundle_ctrl_type=ofp.OFPBCT_OPEN_REQUEST,
             bundle_id=1)
 
         response, _ = self.controller.transact(request)
-        self.assertIsInstance(response, of14.message.bundle_ctrl_msg)
-        self.assertEqual(response.bundle_ctrl_type, of14.OFPBCT_OPEN_REPLY)
+        self.assertIsInstance(response, ofp.message.bundle_ctrl_msg)
+        self.assertEqual(response.bundle_ctrl_type, ofp.OFPBCT_OPEN_REPLY)
         self.assertEqual(response.bundle_id, 1)
 
         for i in xrange(0, 10):
-            request = of14.message.bundle_add_msg(
+            request = ofp.message.bundle_add_msg(
                 xid=i,
                 bundle_id=1,
                 data=ofp.message.echo_request(xid=i).pack())
@@ -77,13 +76,13 @@
         msg, _ = self.controller.poll(ofp.message.echo_reply)
         self.assertIsNone(msg)
 
-        request = of14.message.bundle_ctrl_msg(
-            bundle_ctrl_type=of14.OFPBCT_DISCARD_REQUEST,
+        request = ofp.message.bundle_ctrl_msg(
+            bundle_ctrl_type=ofp.OFPBCT_DISCARD_REQUEST,
             bundle_id=1)
 
         response, _ = self.controller.transact(request)
-        self.assertIsInstance(response, of14.message.bundle_ctrl_msg)
-        self.assertEqual(response.bundle_ctrl_type, of14.OFPBCT_DISCARD_REPLY)
+        self.assertIsInstance(response, ofp.message.bundle_ctrl_msg)
+        self.assertEqual(response.bundle_ctrl_type, ofp.OFPBCT_DISCARD_REPLY)
         self.assertEqual(response.bundle_id, 1)
 
         # Make sure the messages aren't executed
@@ -95,17 +94,17 @@
     Disconnect without explicitly discarding the bundle
     """
     def runTest(self):
-        request = of14.message.bundle_ctrl_msg(
-            bundle_ctrl_type=of14.OFPBCT_OPEN_REQUEST,
+        request = ofp.message.bundle_ctrl_msg(
+            bundle_ctrl_type=ofp.OFPBCT_OPEN_REQUEST,
             bundle_id=1)
 
         response, _ = self.controller.transact(request)
-        self.assertIsInstance(response, of14.message.bundle_ctrl_msg)
-        self.assertEqual(response.bundle_ctrl_type, of14.OFPBCT_OPEN_REPLY)
+        self.assertIsInstance(response, ofp.message.bundle_ctrl_msg)
+        self.assertEqual(response.bundle_ctrl_type, ofp.OFPBCT_OPEN_REPLY)
         self.assertEqual(response.bundle_id, 1)
 
         for i in xrange(0, 10):
-            request = of14.message.bundle_add_msg(
+            request = ofp.message.bundle_add_msg(
                 xid=i,
                 bundle_id=1,
                 data=ofp.message.echo_request(xid=i).pack())
@@ -120,16 +119,16 @@
     This is tied to the limit in Indigo.
     """
     def runTest(self):
-        request = of14.message.bundle_ctrl_msg(
-            bundle_ctrl_type=of14.OFPBCT_OPEN_REQUEST,
+        request = ofp.message.bundle_ctrl_msg(
+            bundle_ctrl_type=ofp.OFPBCT_OPEN_REQUEST,
             bundle_id=1)
 
         response, _ = self.controller.transact(request)
-        self.assertIsInstance(response, of14.message.bundle_ctrl_msg)
-        self.assertEqual(response.bundle_ctrl_type, of14.OFPBCT_OPEN_REPLY)
+        self.assertIsInstance(response, ofp.message.bundle_ctrl_msg)
+        self.assertEqual(response.bundle_ctrl_type, ofp.OFPBCT_OPEN_REPLY)
         self.assertEqual(response.bundle_id, 1)
 
-        request = of14.message.bundle_add_msg(
+        request = ofp.message.bundle_add_msg(
             xid=0,
             bundle_id=1,
             data=ofp.message.echo_request(xid=0).pack())
@@ -150,7 +149,7 @@
         do_barrier(self.controller)
         verify_no_errors(self.controller)
 
-        request = of14.message.bundle_add_msg(
+        request = ofp.message.bundle_add_msg(
             xid=1,
             bundle_id=1,
             data=ofp.message.echo_request(xid=1).pack())
@@ -158,7 +157,7 @@
 
         do_barrier(self.controller)
 
-        msg, _ = self.controller.poll(exp_msg=of14.message.error_msg)
+        msg, _ = self.controller.poll(exp_msg=ofp.message.error_msg)
         self.assertIsNotNone(msg)
 
 class TooManyBytes(base_tests.SimpleProtocol):
@@ -168,19 +167,19 @@
     This is tied to the limit in Indigo.
     """
     def runTest(self):
-        request = of14.message.bundle_ctrl_msg(
-            bundle_ctrl_type=of14.OFPBCT_OPEN_REQUEST,
+        request = ofp.message.bundle_ctrl_msg(
+            bundle_ctrl_type=ofp.OFPBCT_OPEN_REQUEST,
             bundle_id=1)
 
         response, _ = self.controller.transact(request)
-        self.assertIsInstance(response, of14.message.bundle_ctrl_msg)
-        self.assertEqual(response.bundle_ctrl_type, of14.OFPBCT_OPEN_REPLY)
+        self.assertIsInstance(response, ofp.message.bundle_ctrl_msg)
+        self.assertEqual(response.bundle_ctrl_type, ofp.OFPBCT_OPEN_REPLY)
         self.assertEqual(response.bundle_id, 1)
 
         echo_buf = ofp.message.echo_request(xid=0, data="\x00" * 1016).pack()
         self.assertEquals(len(echo_buf), 1024)
 
-        request = of14.message.bundle_add_msg(
+        request = ofp.message.bundle_add_msg(
             xid=0,
             bundle_id=1,
             data=echo_buf)
@@ -204,7 +203,7 @@
         do_barrier(self.controller)
         verify_no_errors(self.controller)
 
-        request = of14.message.bundle_add_msg(
+        request = ofp.message.bundle_add_msg(
             xid=1,
             bundle_id=1,
             data=ofp.message.echo_request(xid=1).pack())
@@ -212,5 +211,5 @@
 
         do_barrier(self.controller)
 
-        msg, _ = self.controller.poll(exp_msg=of14.message.error_msg)
+        msg, _ = self.controller.poll(exp_msg=ofp.message.error_msg)
         self.assertIsNotNone(msg)
