Merge remote-tracking branch 'origin/master'
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/Instruction.java b/core/api/src/main/java/org/onlab/onos/net/flow/Instruction.java
index cc72880..67e3d67 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/Instruction.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/Instruction.java
@@ -34,8 +34,7 @@
     // to create specific instructions.
 
     /**
-     * Returns the type of instruction not to be confused
-     * with the instruction's java type.
+     * Returns the type of instruction.
      * @return type of instruction
      */
     public Type type();
diff --git a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
index ecb4765..dfff4d5 100644
--- a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
+++ b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
@@ -228,6 +228,9 @@
      * @return Packet_out message with LLDP data
      */
     private OFPacketOut createLLDPPacketOut(final OFPortDesc port) {
+        if (port == null) {
+            return null;
+        }
         OFPacketOut.Builder packetOut = this.ofFactory.buildPacketOut();
         packetOut.setBufferId(OFBufferId.NO_BUFFER);
         OFAction act = this.ofFactory.actions().buildOutput()
@@ -248,6 +251,9 @@
      * @return Packet_out message with LLDP data
      */
     private OFPacketOut createBDDPPacketOut(final OFPortDesc port) {
+        if (port == null) {
+            return null;
+        }
         OFPacketOut.Builder packetOut = sw.factory().buildPacketOut();
 
         packetOut.setBufferId(OFBufferId.NO_BUFFER);
@@ -267,6 +273,9 @@
 
 
     private void sendMsg(final OFMessage msg) {
+        if (msg == null) {
+            return;
+        }
         this.sw.sendMsg(msg);
     }
 
@@ -389,8 +398,8 @@
     }
 
     public void stop() {
-        removeAllPorts();
         timeout.cancel();
+        removeAllPorts();
     }
 
 }