diff --git a/olt.py b/olt.py
index 5a91ea5..664365a 100644
--- a/olt.py
+++ b/olt.py
@@ -8,6 +8,7 @@
 
 import ofp
 import time
+import copy
 
 from oftest.testutils import *
 
@@ -87,10 +88,13 @@
 
     pkt = str(parsed_pkt)
 
-    request = ofp.message.flow_add(
+    for of_port in config["port_map"]:
+	m = copy.deepcopy(match)
+        m.oxm_list.append(ofp.oxm.in_port(of_port))
+        request = ofp.message.flow_add(
         table_id=test_param_get("table", 0),
         cookie=42,
-        match=match,
+        match=m,
         instructions=[
             ofp.instruction.apply_actions(
                 actions=[
@@ -99,11 +103,10 @@
                         max_len=ofp.OFPCML_NO_BUFFER)])],
         buffer_id=ofp.OFP_NO_BUFFER,
         priority=1000)
-
-    logging.info("Inserting flow sending matching packets to controller")
-    self.controller.message_send(request)
-    do_barrier(self.controller)
-        
+        logging.info("Inserting flow sending matching packets to controller")
+        self.controller.message_send(request)
+        do_barrier(self.controller)
+       
     for of_port in config["port_map"]:
         logging.info("PacketInExact test, port %d", of_port)
         self.dataplane.send(of_port, pkt)
@@ -139,29 +142,6 @@
         
         testPacketIn(self, match, pkt)
         
-class DHCPPacketIn(base_tests.SimpleDataPlane):
-    
-    """Verify packet-ins are sent for DHCP packets """
-    
-    def runTest(self):
-        logging.info("Running DHCP Packet In test")
-
-        pkt = simple_udp_packet(udp_sport=68, udp_dport=67)
-
-        match = ofp.match()
-        match.oxm_list.append(ofp.oxm.eth_type(0x0800))
-        match.oxm_list.append(ofp.oxm.ip_proto(17))
-        match.oxm_list.append(ofp.oxm.udp_src(68))
-        match.oxm_list.append(ofp.oxm.udp_dst(67))
-        
-        testPacketIn(self, match, pkt)
-        
-        # Other UDP packets should not match the rule
-        radiusPkt = simple_udp_packet(udp_sport=1812, udp_dport=1812)
-
-        self.dataplane.send(1, str(radiusPkt))
-        verify_no_packet_in(self, radiusPkt, 1)    
-        
 class IGMPPacketIn(base_tests.SimpleDataPlane):
     
     """Verify packet-ins are sent for IGMP packets """
@@ -184,7 +164,7 @@
        
     def runTest(self):
         logging.info("Running Meter tests")
-        dropMeterBand = ofp.meter_band.drop(rate = 500)
+        dropMeterBand = ofp.meter_band.drop(rate = 64)
         meter_mod = ofp.message.meter_mod(xid = 1, command = ofp.OFPMC_ADD, meter_id = 1, meters = [ dropMeterBand ])
         self.controller.message_send(meter_mod)
     
@@ -239,10 +219,11 @@
         
         inPkt = simple_udp_packet(dl_vlan_enable=True, vlan_vid=vlan_id, vlan_pcp=0)
         # downstream
-        self.dataplane.send(olt_port, str(inPkt))
-        verify_packet(self, inPkt, onu_port)
+        #self.dataplane.send(olt_port, str(inPkt))
+        #verify_packet(self, inPkt, onu_port)
         # upstream
-        self.dataplane.send(onu_port, str(inPkt))
+        for i in range(1,400):
+		self.dataplane.send(onu_port, str(inPkt))
         verify_packet(self, inPkt, olt_port)
 
         # clean up the test
@@ -805,7 +786,7 @@
             instructions=[
                 ofp.instruction.apply_actions(
                     actions=[
-                        ofp.action.push_vlan(ethertype=0x88A8),
+                        ofp.action.push_vlan(ethertype=0x8100),
                         ofp.action.set_field(ofp.oxm.vlan_vid(ofp.OFPVID_PRESENT | s_vlan_id)),
                         ofp.action.set_field(ofp.oxm.vlan_pcp(0)),
                         ofp.action.output(port=olt_port)]),
