diff --git a/src/main/java/com/intel/jndn/utils/SegmentedClient.java b/src/main/java/com/intel/jndn/utils/SegmentedClient.java
index aa9cb1a..671d6a2 100644
--- a/src/main/java/com/intel/jndn/utils/SegmentedClient.java
+++ b/src/main/java/com/intel/jndn/utils/SegmentedClient.java
@@ -124,11 +124,11 @@
     try {
       lastSegment = segments.get(0).get().getMetaInfo().getFinalBlockId().toSegment();
     } catch (ExecutionException | InterruptedException e) {
-      logger.log(Level.FINE, "Failed to retrieve first segment: ", e);
+      logger.log(Level.FINE, "Failed to retrieve first segment: " + interest.toUri(), e);
       ((FutureData) segments.get(0)).reject(e); // TODO implies knowledge of underlying data structure
       return segments;
     } catch (EncodingException e) {
-      logger.log(Level.FINER, "No FinalBlockId, returning first packet.");
+      logger.log(Level.FINER, "No FinalBlockId, returning first packet: " + interest.toUri());
       return segments;
     }
 
@@ -179,8 +179,9 @@
     try {
       return getAsync(face, interest).get();
     } catch (ExecutionException | InterruptedException e) {
-      logger.log(Level.FINE, "Failed to retrieve data.", e);
-      throw new IOException("Failed to retrieve data.", e);
+      String message = "Failed to retrieve data: " + interest.toUri();
+      logger.log(Level.FINE, message, e);
+      throw new IOException(message, e);
     }
   }
 
diff --git a/src/main/java/com/intel/jndn/utils/client/FutureData.java b/src/main/java/com/intel/jndn/utils/client/FutureData.java
index dc6b393..55c001e 100644
--- a/src/main/java/com/intel/jndn/utils/client/FutureData.java
+++ b/src/main/java/com/intel/jndn/utils/client/FutureData.java
@@ -132,18 +132,18 @@
           face.processEvents();
         }
       } catch (EncodingException | IOException e) {
-        throw new ExecutionException("Failed to retrieve packet.", e);
+        throw new ExecutionException("Failed to retrieve packet while processing events: " + name.toUri(), e);
       }
     }
 
     // case: cancelled
     if (cancelled) {
-      throw new InterruptedException("Interrupted by user.");
+      throw new InterruptedException("Interrupted by user while retrieving packet: " + name.toUri());
     }
 
     // case: error
     if (error != null) {
-      throw new ExecutionException("Future rejected with error.", error);
+      throw new ExecutionException("Error while retrieving packet: " + name.toUri(), error);
     }
 
     return data;
@@ -171,7 +171,7 @@
           face.processEvents();
         }
       } catch (EncodingException | IOException e) {
-        throw new ExecutionException("Failed to retrieve packet.", e);
+        throw new ExecutionException("Failed to retrieve packet while processing events: " + name.toUri(), e);
       }
 
       currentTime = System.currentTimeMillis();
@@ -179,17 +179,17 @@
 
     // case: cancelled
     if (cancelled) {
-      throw new InterruptedException("Interrupted by user.");
+      throw new InterruptedException("Interrupted by user while retrieving packet: " + name.toUri());
     }
 
     // case: error
     if (error != null) {
-      throw new ExecutionException("Future rejected with error.", error);
+      throw new ExecutionException("Error while retrieving packet: " + name.toUri(), error);
     }
 
     // case: timed out
     if (currentTime > endTime) {
-      throw new TimeoutException("Timed out.");
+      throw new TimeoutException("Timed out while retrieving packet: " + name.toUri());
     }
 
     return data;
diff --git a/src/main/java/com/intel/jndn/utils/client/SegmentedFutureData.java b/src/main/java/com/intel/jndn/utils/client/SegmentedFutureData.java
index dec33df..403e2da 100644
--- a/src/main/java/com/intel/jndn/utils/client/SegmentedFutureData.java
+++ b/src/main/java/com/intel/jndn/utils/client/SegmentedFutureData.java
@@ -122,7 +122,7 @@
       try {
         content.write(futureData.get().getContent().getImmutableArray());
       } catch (ExecutionException | IOException | InterruptedException e) {
-        throw new ExecutionException("Failed while aggregating retrieved packets.", e);
+        throw new ExecutionException("Failed while aggregating retrieved packets: " + name.toUri(), e);
       }
     }
 
@@ -154,12 +154,12 @@
       try {
         content.write(futureData.get().getContent().getImmutableArray());
       } catch (ExecutionException | IOException | InterruptedException e) {
-        throw new ExecutionException("Failed while aggregating retrieved packets.", e);
+        throw new ExecutionException("Failed while aggregating retrieved packets: " + name.toUri(), e);
       }
 
       // check for timeout
       if (System.currentTimeMillis() > endTime) {
-        throw new TimeoutException("Timed out.");
+        throw new TimeoutException("Timed out while retrieving packets: " + name.toUri());
       }
     }
 
diff --git a/src/main/java/com/intel/jndn/utils/repository/Repository.java b/src/main/java/com/intel/jndn/utils/repository/Repository.java
index 4647b9f..f64c145 100644
--- a/src/main/java/com/intel/jndn/utils/repository/Repository.java
+++ b/src/main/java/com/intel/jndn/utils/repository/Repository.java
@@ -13,7 +13,6 @@
  */
 package com.intel.jndn.utils.repository;
 
-import com.intel.jndn.utils.repository.DataNotFoundException;
 import net.named_data.jndn.Data;
 import net.named_data.jndn.Interest;
 
diff --git a/src/test/java/com/intel/jndn/utils/SegmentedClientTest.java b/src/test/java/com/intel/jndn/utils/SegmentedClientTest.java
index 11f17a9..319ee6a 100644
--- a/src/test/java/com/intel/jndn/utils/SegmentedClientTest.java
+++ b/src/test/java/com/intel/jndn/utils/SegmentedClientTest.java
@@ -14,7 +14,6 @@
 package com.intel.jndn.utils;
 
 import com.intel.jndn.mock.MockFace;
-import com.intel.jndn.mock.MockTransport;
 import com.intel.jndn.utils.client.SegmentedFutureData;
 import java.io.IOException;
 import java.util.List;
@@ -22,7 +21,6 @@
 import java.util.concurrent.Future;
 import java.util.logging.Logger;
 import net.named_data.jndn.Data;
-import net.named_data.jndn.Face;
 import net.named_data.jndn.Interest;
 import net.named_data.jndn.Name;
 import net.named_data.jndn.Name.Component;
@@ -42,9 +40,9 @@
 
   private static final Logger logger = Logger.getLogger(SimpleClient.class.getName());
   private MockFace face;
-  
+
   @Before
-  public void beforeTest(){
+  public void beforeTest() {
     face = new MockFace();
   }
 
@@ -143,6 +141,28 @@
   }
 
   /**
+   * Verify that segmented content is the correct length when retrieved by the
+   * client.
+   *
+   * @throws Exception
+   */
+  @Test
+  public void testContentLength() throws Exception {
+    Data data1 = new Data(new Name("/test/content-length").appendSegment(0));
+    data1.setContent(new Blob("0123456789"));
+    data1.getMetaInfo().setFinalBlockId(Name.Component.fromNumberWithMarker(1, 0x00));
+    face.addResponse(data1.getName(), data1);
+    
+    Data data2 = new Data(new Name("/test/content-length").appendSegment(1));
+    data2.setContent(new Blob("0123456789"));
+    data1.getMetaInfo().setFinalBlockId(Name.Component.fromNumberWithMarker(1, 0x00));
+    face.addResponse(data2.getName(), data2);
+
+    Future<Data> result = SegmentedClient.getDefault().getAsync(face, new Name("/test/content-length").appendSegment(0));
+    assertEquals(20, result.get().getContent().size());
+  }
+
+  /**
    * If a Data packet does not have a FinalBlockId, the SegmentedClient should
    * just return the packet.
    *
