diff --git a/providers/lldp/src/main/java/org/onlab/onos/provider/lldp/impl/LLDPLinkProvider.java b/providers/lldp/src/main/java/org/onlab/onos/provider/lldp/impl/LLDPLinkProvider.java
index 023940e..f4ab71d 100644
--- a/providers/lldp/src/main/java/org/onlab/onos/provider/lldp/impl/LLDPLinkProvider.java
+++ b/providers/lldp/src/main/java/org/onlab/onos/provider/lldp/impl/LLDPLinkProvider.java
@@ -8,6 +8,7 @@
 import org.onlab.onos.net.ConnectPoint;
 import org.onlab.onos.net.Device;
 import org.onlab.onos.net.DeviceId;
+import org.onlab.onos.net.Port;
 import org.onlab.onos.net.device.DeviceEvent;
 import org.onlab.onos.net.device.DeviceListener;
 import org.onlab.onos.net.device.DeviceService;
@@ -90,53 +91,50 @@
         public void event(DeviceEvent event) {
             LinkDiscovery ld = null;
             Device device = event.subject();
-            // it's not a switch so leave.
-            if (device.type() != Device.Type.SWITCH) {
-                return;
-            }
+            Port port = event.port();
             switch (event.type()) {
                 case DEVICE_ADDED:
-                    discoverers.put(event.subject().id(),
-                                    new LinkDiscovery(event.subject(), packetSevice,
+                    discoverers.put(device.id(),
+                                    new LinkDiscovery(device, packetSevice,
                                                       providerService, useBDDP));
                     break;
                 case PORT_ADDED:
                 case PORT_UPDATED:
                     if (event.port().isEnabled()) {
-                        ld = discoverers.get(event.subject().id());
+                        ld = discoverers.get(device.id());
                         if (ld == null) {
                             return;
                         }
-                        ld.addPort(event.port());
+                        ld.addPort(port);
                     } else {
-                        ConnectPoint point = new ConnectPoint(event.subject().id(),
-                                                              event.port().number());
+                        ConnectPoint point = new ConnectPoint(device.id(),
+                                                              port.number());
                         providerService.linksVanished(point);
                     }
                     break;
                 case PORT_REMOVED:
-                    ConnectPoint point = new ConnectPoint(event.subject().id(),
-                                                          event.port().number());
+                    ConnectPoint point = new ConnectPoint(device.id(),
+                                                          port.number());
                     providerService.linksVanished(point);
                     break;
                 case DEVICE_REMOVED:
                 case DEVICE_SUSPENDED:
-                    ld = discoverers.get(event.subject().id());
+                    ld = discoverers.get(device.id());
                     if (ld == null) {
                         return;
                     }
                     ld.stop();
-                    providerService.linksVanished(event.subject().id());
+                    providerService.linksVanished(device.id());
                     break;
                 case DEVICE_AVAILABILITY_CHANGED:
-                    ld = discoverers.get(event.subject().id());
+                    ld = discoverers.get(device.id());
                     if (ld == null) {
                         return;
                     }
-                    if (deviceService.isAvailable(event.subject().id())) {
+                    if (deviceService.isAvailable(device.id())) {
                         ld.start();
                     } else {
-                        providerService.linksVanished(event.subject().id());
+                        providerService.linksVanished(device.id());
                         ld.stop();
                     }
                     break;
diff --git a/providers/lldp/src/main/java/org/onlab/onos/provider/lldp/impl/LinkDiscovery.java b/providers/lldp/src/main/java/org/onlab/onos/provider/lldp/impl/LinkDiscovery.java
index fc0a0f4..6ad6124 100644
--- a/providers/lldp/src/main/java/org/onlab/onos/provider/lldp/impl/LinkDiscovery.java
+++ b/providers/lldp/src/main/java/org/onlab/onos/provider/lldp/impl/LinkDiscovery.java
@@ -184,14 +184,13 @@
                 this.slowPorts.remove(portNumber);
                 this.fastPorts.add(portNumber);
                 this.portProbeCount.put(portNumber, new AtomicInteger(0));
-            } else {
-                if (this.fastPorts.contains(portNumber)) {
+            } else if (this.fastPorts.contains(portNumber)) {
                     this.portProbeCount.get(portNumber).set(0);
-                } else {
+            } else {
                     this.log.debug(
                             "Got ackProbe for non-existing port: {}",
                             portNumber);
-                }
+
             }
         }
     }
@@ -256,7 +255,7 @@
                     //fastIterator.remove();
                     //this.slowPorts.add(portNumber);
                     //this.portProbeCount.remove(portNumber);
-
+                    this.portProbeCount.get(portNumber).set(0);
 
                     ConnectPoint cp = new ConnectPoint(
                             device.id(),
