diff --git a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/MatchAggregator.java b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/MatchAggregator.java
index 19e4709..9720d6d 100644
--- a/plugin/src/main/java/de/ids_mannheim/korap/plkexport/MatchAggregator.java
+++ b/plugin/src/main/java/de/ids_mannheim/korap/plkexport/MatchAggregator.java
@@ -34,6 +34,11 @@
      */
     public MatchAggregator (String resp) throws IOException {
 
+        matches = new LinkedList();
+
+        if (resp == null)
+            return;
+        
         JsonParser parser = mapper.getFactory().createParser(resp);
         JsonNode actualObj = mapper.readTree(parser);
 
@@ -52,12 +57,12 @@
         
         // Iterate over the results of the current file
         Iterator<JsonNode> mNode = mNodes.elements();
-        matches = new LinkedList();
         while (mNode.hasNext()) {
             this.matches.add(mNode.next());
         };
     };
 
+
     /**
      * Append more matches to the result set.
      */
@@ -87,16 +92,17 @@
         };
     };
 
+
     /**
      * Return an iterator for all matches
      */
-    public Iterator<JsonNode> iterator() { 
+    public MatchIterator iterator() { 
         return new MatchIterator(); 
     };
 
 
     // Private iterator class
-    private class MatchIterator implements Iterator<JsonNode> {
+    public class MatchIterator implements Iterator<JsonNode> {
         private int listIndex, fileIndex;
 
         // Constructor
@@ -109,7 +115,7 @@
 
         @Override
         public boolean hasNext () {
-            if (listIndex >= 0 || fileIndex >= 0) {
+            if (this.listIndex >= 0 || this.fileIndex >= 0) {
                 return true;
             };
             return false;
@@ -117,10 +123,12 @@
 
         @Override
         public JsonNode next () {
-            if (this.listIndex > 0) {
+            if (this.listIndex >= 0) {
                 int i = this.listIndex;
-                if (i >= matches.size()) {
+                if (i >= matches.size() - 1) {
                     this.listIndex = -1;
+                } else {
+                    this.listIndex++;
                 };
                 return matches.get(i);
             };
diff --git a/plugin/src/test/java/de/ids_mannheim/korap/plkexport/MatchAggregatorTest.java b/plugin/src/test/java/de/ids_mannheim/korap/plkexport/MatchAggregatorTest.java
index a819414..2859597 100644
--- a/plugin/src/test/java/de/ids_mannheim/korap/plkexport/MatchAggregatorTest.java
+++ b/plugin/src/test/java/de/ids_mannheim/korap/plkexport/MatchAggregatorTest.java
@@ -5,6 +5,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.fail;
 import org.junit.Test;
 
@@ -18,6 +19,16 @@
         assertNull(m.meta);
         assertNull(m.query);
         assertNull(m.collection);
+
+        MatchAggregator.MatchIterator mi = m.iterator();
+
+        assertFalse(mi.hasNext());
+        assertNull(mi.next());
+
+        m = new MatchAggregator(null);
+        assertNull(m.meta);
+        assertNull(m.query);
+        assertNull(m.collection);
     };
 
     @Test
@@ -29,4 +40,22 @@
         assertNull(m.query);
         assertNull(m.collection);
     };
+  
+    @Test
+    public void testMatchesInit () throws IOException {
+        MatchAggregator m = new MatchAggregator(
+            "{\"matches\":[\"first\",\"second\"]}"
+            );
+        assertNull(m.meta);
+        assertNull(m.query);
+        assertNull(m.collection);
+
+        MatchAggregator.MatchIterator mi = m.iterator();
+
+        assertTrue(mi.hasNext());
+        assertEquals(mi.next().toString(),"\"first\"");
+        assertTrue(mi.hasNext());
+        assertEquals(mi.next().toString(),"\"second\"");
+        assertFalse(mi.hasNext());
+    };
 };
