diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/OltPipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/OltPipeline.java
index d5b5ac1..4ccb9e3 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/OltPipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/OltPipeline.java
@@ -415,13 +415,14 @@
 
     private void installNoModificationRules(ForwardingObjective fwd) {
         Instructions.OutputInstruction output = (Instructions.OutputInstruction) fetchOutput(fwd, DOWNSTREAM);
+        Instructions.MetadataInstruction writeMetadata = fetchWriteMetadata(fwd);
+        Instructions.MeterInstruction meter = (Instructions.MeterInstruction) fetchMeter(fwd);
 
         TrafficSelector selector = fwd.selector();
 
         Criterion inport = selector.getCriterion(Criterion.Type.IN_PORT);
         Criterion outerVlan = selector.getCriterion(Criterion.Type.VLAN_VID);
         Criterion innerVlan = selector.getCriterion(Criterion.Type.INNER_VLAN_VID);
-        Criterion metadata;
 
         if (inport == null || output == null || innerVlan == null || outerVlan == null) {
             log.error("Forwarding objective is underspecified: {}", fwd);
@@ -429,15 +430,14 @@
             return;
         }
 
-        metadata = Criteria.matchMetadata(((VlanIdCriterion) innerVlan).vlanId().toShort());
 
         FlowRule.Builder outer = DefaultFlowRule.builder()
                 .fromApp(fwd.appId())
                 .forDevice(deviceId)
                 .makePermanent()
                 .withPriority(fwd.priority())
-                .withSelector(buildSelector(inport, outerVlan, metadata))
-                .withTreatment(buildTreatment(output));
+                .withSelector(buildSelector(inport, outerVlan))
+                .withTreatment(buildTreatment(output, writeMetadata, meter));
 
         applyRules(fwd, outer);
     }
diff --git a/providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/OpenFlowMeterProvider.java b/providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/OpenFlowMeterProvider.java
index 87abcd0..ce8e307 100644
--- a/providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/OpenFlowMeterProvider.java
+++ b/providers/openflow/meter/src/main/java/org/onosproject/provider/of/meter/impl/OpenFlowMeterProvider.java
@@ -138,6 +138,8 @@
                 .expireAfterWrite(TIMEOUT, TimeUnit.SECONDS)
                 .removalListener((RemovalNotification<Long, MeterOperation> notification) -> {
                     if (notification.getCause() == RemovalCause.EXPIRED) {
+                        log.debug("Expired on meter provider. Meter key {} and operation {}",
+                                notification.getKey(), notification.getValue());
                         providerService.meterOperationFailed(notification.getValue(),
                                                              MeterFailReason.TIMEOUT);
                     }
@@ -205,9 +207,6 @@
 
     private void performOperation(OpenFlowSwitch sw, MeterOperation op) {
 
-        pendingOperations.put(op.meter().id().id(), op);
-
-
         Meter meter = op.meter();
         MeterModBuilder builder = MeterModBuilder.builder(meter.id().id(), sw.factory());
         if (meter.isBurst()) {
@@ -219,12 +218,14 @@
 
         switch (op.type()) {
             case ADD:
+                pendingOperations.put(op.meter().id().id(), op);
                 sw.sendMsg(builder.add());
                 break;
             case REMOVE:
                 sw.sendMsg(builder.remove());
                 break;
             case MODIFY:
+                pendingOperations.put(op.meter().id().id(), op);
                 sw.sendMsg(builder.modify());
                 break;
             default:
