diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
index 09808d5..5a06bc2 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/SegmentRoutingManager.java
@@ -984,7 +984,7 @@
                 log.warn(e.getMessage() + " Aborting processDeviceAdded.");
                 return;
             }
-            log.debug("updating groupHandlerMap with new config for device: {}",
+            log.debug("updating groupHandlerMap with new grpHdlr for device: {}",
                     deviceId);
             groupHandlerMap.put(deviceId, groupHandler);
         }
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
index 31ed338..0867fab 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
@@ -412,7 +412,7 @@
         if (nextId == -1) {
             if (portUp) {
                 log.debug("**Creating flooding group for first port enabled in"
-                        + " subnet {} on dev {} port {}", vlanId, deviceId, port);
+                        + " vlan {} on dev {} port {}", vlanId, deviceId, port);
                 createBcastGroupFromVlan(vlanId, Collections.singleton(port));
             } else {
                 log.warn("Could not find flooding group for subnet {} on dev:{} when"
@@ -830,8 +830,8 @@
             );
         NextObjective nextObj = nextObjBuilder.add(context);
         flowObjectiveService.next(deviceId, nextObj);
-        log.debug("createBcastGroupFromVlan: Submited next objective {} in device {}",
-                  nextId, deviceId);
+        log.debug("createBcastGroupFromVlan: Submitted next objective {} "
+                + "for vlan: {} in device {}", nextId, vlanId, deviceId);
 
         vlanNextObjStore.put(key, nextId);
     }
diff --git a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
index 5eaaebb..240d09b 100644
--- a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
@@ -15,6 +15,7 @@
  */
 package org.onosproject.net.flowobjective.impl;
 
+import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 import org.apache.felix.scr.annotations.Activate;
@@ -133,7 +134,7 @@
     // instance, via the DistributedFlowObjectiveStore.
     private final Map<Integer, Set<PendingFlowObjective>> pendingForwards =
             Maps.newConcurrentMap();
-    private final Map<Integer, Set<PendingFlowObjective>> pendingNexts =
+    private final Map<Integer, List<PendingFlowObjective>> pendingNexts =
             Maps.newConcurrentMap();
 
     // local store to track which nextObjectives were sent to which device
@@ -309,7 +310,7 @@
                 pendingNexts.compute(next.id(), (id, pending) -> {
                     PendingFlowObjective pendfo = new PendingFlowObjective(deviceId, next);
                     if (pending == null) {
-                        return Sets.newHashSet(pendfo);
+                        return Lists.newArrayList(pendfo);
                     } else {
                         pending.add(pendfo);
                         return pending;
@@ -505,17 +506,18 @@
                 }
 
                 // now check for pending next-objectives
+                List<PendingFlowObjective> pendNexts;
                 synchronized (pendingNexts) {
                     // needs to be synchronized for queueObjective lookup
-                    pending = pendingNexts.remove(event.subject());
+                    pendNexts = pendingNexts.remove(event.subject());
                 }
-                if (pending == null) {
+                if (pendNexts == null) {
                     log.debug("No next objectives pending for this "
                             + "obj event {}", event);
                 } else {
                     log.debug("Processing {} pending next objectives for nextId {}",
-                              pending.size(), event.subject());
-                    pending.forEach(p -> getDevicePipeliner(p.deviceId())
+                              pendNexts.size(), event.subject());
+                    pendNexts.forEach(p -> getDevicePipeliner(p.deviceId())
                                     .next((NextObjective) p.flowObjective()));
                 }
             }
@@ -621,7 +623,7 @@
         }
 
         for (Integer nextId : pendingNexts.keySet()) {
-            Set<PendingFlowObjective> pnext = pendingNexts.get(nextId);
+            List<PendingFlowObjective> pnext = pendingNexts.get(nextId);
             StringBuilder pend = new StringBuilder();
             pend.append("NextId: ")
                     .append(nextId);
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
index 8c64ded..10009d7 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/ofdpa/Ofdpa2Pipeline.java
@@ -635,6 +635,9 @@
             TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
             if (matchInPortTmacTable()) {
                 selector.matchInPort(pnum);
+            } else {
+                log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
+                        "ignoring the IN_PORT criteria");
             }
             if (requireVlanExtensions()) {
                 selector.extension(ofdpaMatchVlanVid, deviceId);
@@ -658,6 +661,9 @@
             treatment = DefaultTrafficTreatment.builder();
             if (matchInPortTmacTable()) {
                 selector.matchInPort(pnum);
+            } else {
+                log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
+                        "ignoring the IN_PORT criteria");
             }
             if (requireVlanExtensions()) {
                 selector.extension(ofdpaMatchVlanVid, deviceId);
@@ -683,6 +689,9 @@
             treatment = DefaultTrafficTreatment.builder();
             if (matchInPortTmacTable()) {
                 selector.matchInPort(pnum);
+            } else {
+                log.debug("Pipeline does not support IN_PORT matching in TMAC table, " +
+                        "ignoring the IN_PORT criteria");
             }
             if (requireVlanExtensions()) {
                 selector.extension(ofdpaMatchVlanVid, deviceId);
