diff --git a/app/src/main/java/org/opencord/olt/impl/OltMeterService.java b/app/src/main/java/org/opencord/olt/impl/OltMeterService.java
index 80aae4a..be15854 100644
--- a/app/src/main/java/org/opencord/olt/impl/OltMeterService.java
+++ b/app/src/main/java/org/opencord/olt/impl/OltMeterService.java
@@ -225,6 +225,8 @@
 
                     @Override
                     public void onError(MeterRequest op, MeterFailReason reason) {
+                        log.error("Failed installing meter {} on {} for {}",
+                                  meterIdRef.get(), deviceId, bpInfo.id());
                         bpInfoToMeter.remove(bpInfo.id(),
                                              MeterKey.key(deviceId, meterIdRef.get()));
                         meterFuture.complete(reason);
@@ -247,12 +249,28 @@
                 .filter(e -> e.getValue().deviceId().equals(deviceId))
                 .collect(Collectors.toList());
 
+        //TODO move to purgeMeters from ONOS 2.2.3-SNAPSHOT
         meters.forEach(e -> bpInfoToMeter.remove(e.getKey(), e.getValue()));
         List<Meter> metersToRemove = ImmutableList.copyOf(meterService.getMeters(deviceId));
         metersToRemove.forEach(meter -> {
             MeterRequest mq = DefaultMeterRequest.builder().fromApp(appId)
                     .forDevice(deviceId).withBands(meter.bands())
-                    .withUnit(meter.unit()).remove();
+                    .withUnit(meter.unit())
+                    .withContext(new MeterContext() {
+                        @Override
+                        public void onSuccess(MeterRequest op) {
+                            log.debug("Meter {} is removed from the device {}",
+                                      meter.meterCellId(), deviceId);
+                        }
+
+                        @Override
+                        public void onError(MeterRequest op, MeterFailReason reason) {
+                            log.error("Meter {} failed to be removed from the device {}",
+                                      meter.meterCellId(), deviceId);
+                        }
+                    })
+                    .burst()
+                    .remove();
             meterService.withdraw(mq, meter.id());
         });
     }
diff --git a/app/src/main/java/org/opencord/olt/impl/SubscriberFlowInfo.java b/app/src/main/java/org/opencord/olt/impl/SubscriberFlowInfo.java
index f923b83..1ac5b08 100644
--- a/app/src/main/java/org/opencord/olt/impl/SubscriberFlowInfo.java
+++ b/app/src/main/java/org/opencord/olt/impl/SubscriberFlowInfo.java
@@ -160,15 +160,13 @@
                 nniPort.equals(flowInfo.nniPort) &&
                 uniPort.equals(flowInfo.uniPort) &&
                 tagInfo.equals(flowInfo.tagInfo) &&
-                downId.equals(flowInfo.downId) &&
-                upId.equals(flowInfo.upId) &&
                 downBpInfo.equals(flowInfo.downBpInfo) &&
                 upBpInfo.equals(flowInfo.upBpInfo);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(devId, nniPort, uniPort, tagInfo, downId, upId, downBpInfo, upBpInfo);
+        return Objects.hash(devId, nniPort, uniPort, tagInfo, downBpInfo, upBpInfo);
     }
 
     @Override
