diff --git a/src/main/java/com/intel/jndn/management/Nfdc.java b/src/main/java/com/intel/jndn/management/Nfdc.java
index f8a780d..2be7755 100644
--- a/src/main/java/com/intel/jndn/management/Nfdc.java
+++ b/src/main/java/com/intel/jndn/management/Nfdc.java
@@ -569,12 +569,16 @@
    */
   private static ControlResponse sendCommand(final Face face, final Name name) throws IOException, EncodingException,
     ManagementException {
+    if (face == null) {
+      throw new IllegalArgumentException("Face parameter is null.");
+    }
+
     Interest interest = new Interest(name);
 
     // forwarder must have command signing info set
     try {
       face.makeCommandInterest(interest);
-    } catch (NullPointerException | SecurityException e) {
+    } catch (SecurityException e) {
       throw new IllegalArgumentException("Failed to make command interest; ensure command signing info is set on the " +
         "face.", e);
     }
diff --git a/src/main/java/com/intel/jndn/management/helpers/FetchHelper.java b/src/main/java/com/intel/jndn/management/helpers/FetchHelper.java
index 2b92a54..b22a18a 100644
--- a/src/main/java/com/intel/jndn/management/helpers/FetchHelper.java
+++ b/src/main/java/com/intel/jndn/management/helpers/FetchHelper.java
@@ -28,11 +28,10 @@
 import java.util.logging.Logger;
 
 /**
- * Trival NDN client to fetch one or multiple Data packets.
+ * Trivial NDN client to fetch one or multiple data packets.
  */
 public final class FetchHelper implements OnData, OnTimeout {
-  public static final long DEFAULT_TIMEOUT = 2000;
-
+  private static final long DEFAULT_TIMEOUT = 2000;
   private static final Logger LOG = Logger.getLogger(FetchHelper.class.getName());
   private static final int SLEEP_TIMEOUT = 20;
   private static final int SEGMENT_NAME_COMPONENT_OFFSET = -1;
@@ -44,12 +43,6 @@
   /////////////////////////////////////////////////////////////////////////////
 
   /**
-   * Prevent creation of FetchHelper instances: use getData or getSegmentedData.
-   */
-  private FetchHelper() {
-  }
-
-  /**
    * Private constructor: use getData or getSegmentedData.
    */
   private FetchHelper(final Face face) {
@@ -119,16 +112,18 @@
 
     Data data = fetcher.getData(interest);
 
-    try {
-      data.getName().get(SEGMENT_NAME_COMPONENT_OFFSET).toSegment();
-    } catch (ArrayIndexOutOfBoundsException | EncodingException e) {
-      throw new IOException("Retrieved data does not have segment number as the last name component", e);
-    }
     if (data.getName().size() != prefix.size() + 2) {
-      throw new IOException("Retrieved data is not part of segmented stream");
+      throw new IOException("Retrieved data is not part of segmented stream; " +
+              "data name must end with .../[version]/[segment]");
     }
 
-    long finalBlockId = 0;
+    try {
+      data.getName().get(SEGMENT_NAME_COMPONENT_OFFSET).toSegment();
+    } catch (EncodingException e) {
+      throw new IOException("Retrieved data does not have segment number as the last name component", e);
+    }
+
+    long finalBlockId;
     try {
       finalBlockId = data.getMetaInfo().getFinalBlockId().toSegment();
     } catch (EncodingException e) {
@@ -167,7 +162,7 @@
       try {
         Thread.sleep(SLEEP_TIMEOUT);
       } catch (InterruptedException e) {
-        // ok
+        Thread.currentThread().interrupt();
       }
     }
 
@@ -189,7 +184,7 @@
     state.nRetries--;
     if (state.nRetries > 0) {
       try {
-        face.expressInterest(new Interest(interest).setNonce(null), this, this);
+        face.expressInterest(new Interest(interest), this, this);
       } catch (IOException e) {
         LOG.log(Level.INFO, "Error while expressing interest: " + e.toString(), e);
       }
