diff --git a/Changes b/Changes
index e6c2849..61d9b4c 100644
--- a/Changes
+++ b/Changes
@@ -8,7 +8,9 @@
     - [bugfix] Remove entries from matchList that are not in the same
       document in NextSpans (diewald)
     - [bugfix] Fixed skipTo in NextSpans, see de.ids_mannheim.korap.index.
-      TestRepetitionIndex.testRepetitionSnippetBug3() (margaretha)  
+      TestRepetitionIndex.testRepetitionSnippetBug3() (margaretha)
+    - [bugfix] Fixed the candidate list in NextSpans, see de.ids_mannheim.
+      korap.index.TestNextIndex.testNextExpansion() (margaretha)   
 
 0.58.0 2018-09-03
     - [feature] Implemented referencing cached collection (margaretha)
diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/NextSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/NextSpans.java
index 2ea1377..fb5b254 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/NextSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/NextSpans.java
@@ -178,7 +178,7 @@
             if (cs.getStart() == firstSpans.end()) {
                 addMatch(cs);
             }
-            else {
+            else if (cs.getEnd() < firstSpans.end()){
                 i.remove();
             }
         }
diff --git a/src/test/java/de/ids_mannheim/korap/TestSimple.java b/src/test/java/de/ids_mannheim/korap/TestSimple.java
index 1d7cb99..64ce39f 100644
--- a/src/test/java/de/ids_mannheim/korap/TestSimple.java
+++ b/src/test/java/de/ids_mannheim/korap/TestSimple.java
@@ -1,28 +1,43 @@
 package de.ids_mannheim.korap;
 
-import java.util.*;
-import java.io.*;
+import static de.ids_mannheim.korap.util.KrillByte.byte2int;
+import static org.junit.Assert.fail;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
 import java.net.URLDecoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
-import static org.junit.Assert.*;
-
-import de.ids_mannheim.korap.KrillQuery;
-import de.ids_mannheim.korap.query.QueryBuilder;
-import de.ids_mannheim.korap.index.*;
-import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
-import de.ids_mannheim.korap.util.QueryException;
-import de.ids_mannheim.korap.util.CorpusDataException;
-
-import static de.ids_mannheim.korap.util.KrillByte.*;
-
-import org.apache.lucene.index.*;
-import org.apache.lucene.document.*;
-import org.apache.lucene.search.spans.Spans;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.FieldType;
+import org.apache.lucene.document.TextField;
+import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.LeafReaderContext;
+import org.apache.lucene.index.Term;
+import org.apache.lucene.index.TermContext;
 import org.apache.lucene.search.spans.SpanQuery;
+import org.apache.lucene.search.spans.Spans;
 import org.apache.lucene.util.Bits;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import de.ids_mannheim.korap.index.FieldDocument;
+import de.ids_mannheim.korap.index.MultiTermToken;
+import de.ids_mannheim.korap.index.MultiTermTokenStream;
+import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
+import de.ids_mannheim.korap.response.Result;
+import de.ids_mannheim.korap.util.CorpusDataException;
+import de.ids_mannheim.korap.util.QueryException;
+
 /**
  * Helper class for testing the KrillIndex framework (Simple).
  * 
@@ -60,9 +75,13 @@
         w.addDocument(doc);
     };
 
-    // Add document
     public static FieldDocument simpleFieldDoc (String s) {
-        String[] characters = s.split("");
+        return simpleFieldDoc(s, "");
+    }
+            
+    // Add document
+    public static FieldDocument simpleFieldDoc (String s, String delimiter) {
+        String[] characters = s.split(delimiter);
 
         FieldDocument fd = new FieldDocument();
         String surface = "";
@@ -80,11 +99,12 @@
         return fd;
     };
 
+    // Create a new FieldDocument with random data
     public static FieldDocument simpleFuzzyFieldDoc (List<String> chars, int minLength, int maxLength) {
         String surface = "";
 
         for (int i = 0; i < (int)(Math.random() * (maxLength - minLength)) + minLength; i++) {
-            String randomChar = chars.get((int)(Math.random() * 6));
+            String randomChar = chars.get((int)(Math.random() * chars.size()));
             surface += randomChar;
         };
         return simpleFieldDoc(surface);
@@ -189,4 +209,56 @@
         };
         return spanArray;
     };
+
+
+    // Simple fuzzing test
+    public static void fuzzingTest (List<String> chars, Pattern resultPattern,
+            SpanQuery sq, int minTextLength, int maxTextLength, int maxDocs)
+            throws IOException, QueryException {
+
+        Krill ks = new Krill(sq);
+        String lastFailureConf = "";
+
+        // Multiple runs of corpus creation and query checks
+        for (int x = 0; x < 100000; x++) {
+            KrillIndex ki = new KrillIndex();
+            ArrayList<String> list = new ArrayList<String>();
+            int c = 0;
+
+            // Create a corpus of <= maxDocs fuzzy docs
+            for (int i = 0; i < (int) (Math.random() * maxDocs); i++) {
+                FieldDocument testDoc = simpleFuzzyFieldDoc(chars,
+                        minTextLength, maxTextLength);
+                String testString = testDoc.doc.getField("base").stringValue();
+                Matcher m = resultPattern.matcher(testString);
+                list.add(testString);
+                int offset = 0;
+                while (m.find(offset)) {
+                    c++;
+                    offset = Math.max(0, m.start() + 1);
+                }
+                ki.addDoc(testDoc);
+            };
+
+            ki.commit();
+            Result kr = ks.apply(ki);
+            
+            // Check if the regex-calculated matches are correct,
+            // otherwise
+            // spit out the corpus configurations
+            if (c != kr.getTotalResults()) {
+                String failureConf = "expected:" + c + ", actual:"
+                        + kr.getTotalResults() + ", docs:" + list.toString();
+
+                // Try to keep the failing configuration small
+                if (lastFailureConf.length() == 0
+                        || failureConf.length() < lastFailureConf.length()) {
+                    System.err.println(failureConf);
+                    lastFailureConf = failureConf;
+                    minTextLength--;
+                    maxDocs--;
+                };
+            };
+        };
+    };
 };
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
index 7407ed3..93ee0ab 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestNextIndex.java
@@ -1,5 +1,6 @@
 package de.ids_mannheim.korap.index;
 
+import static de.ids_mannheim.korap.TestSimple.simpleFieldDoc;
 import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
@@ -15,10 +16,10 @@
 import de.ids_mannheim.korap.KrillIndex;
 import de.ids_mannheim.korap.query.SpanClassQuery;
 import de.ids_mannheim.korap.query.SpanElementQuery;
+import de.ids_mannheim.korap.query.SpanExpansionQuery;
 import de.ids_mannheim.korap.query.SpanFocusQuery;
 import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.wrap.SpanSequenceQueryWrapper;
-import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.response.Result;
 
 @RunWith(JUnit4.class)
@@ -27,6 +28,45 @@
     // Todo: primary data as a non-indexed field separated.
 
     @Test
+    public void testNextExpansion () throws IOException {
+        KrillIndex ki = new KrillIndex();
+        ki.addDoc(simpleFieldDoc("ccecc"));
+        ki.commit();
+
+        SpanTermQuery stq = new SpanTermQuery(new Term("base", "s:c"));
+        SpanExpansionQuery seq = new SpanExpansionQuery(stq, 0, 2, 0, true);
+        Result kr = ki.search(seq, (short) 20);
+//        assertEquals(8, kr.getTotalResults());
+        assertEquals(12, kr.getTotalResults());
+        
+        SpanNextQuery snq = new SpanNextQuery(seq, stq);
+        kr = ki.search(snq, (short) 10);
+
+        // cc ccec cec cecc cc
+        // 1-3 1-5 2-5 2-6 4-6
+        assertEquals(5, kr.getTotalResults());
+    }
+    
+    @Test
+    public void testNextExpansion2 () throws IOException {
+        KrillIndex ki = new KrillIndex();
+        ki.addDoc(simpleFieldDoc("cccc"));
+        ki.commit();
+
+        SpanTermQuery stq = new SpanTermQuery(new Term("base", "s:c"));
+        SpanExpansionQuery seq = new SpanExpansionQuery(stq, 0, 2, 0, true);
+//        Result kr = ki.search(seq, (short) 20);
+//        assertEquals(12, kr.getTotalResults());
+        
+        SpanNextQuery snq = new SpanNextQuery(seq, stq);
+        Result kr = ki.search(snq, (short) 10);
+
+        // cc ccc cccc cc  ccc cc
+        // 1-3 1-4 1-5 2-4 2-5 3-5
+        assertEquals(6, kr.getTotalResults());
+    }
+
+    @Test
     public void indexExample1 () throws IOException {
         KrillIndex ki = new KrillIndex();
 
@@ -71,7 +111,6 @@
         assertEquals(1, ki.numberOf("base", "documents"));
         assertEquals(10, ki.numberOf("base", "t"));
 
-
         sq = new SpanNextQuery(new SpanTermQuery(new Term("base", "s:a")),
                 new SpanNextQuery(new SpanTermQuery(new Term("base", "s:b")),
                         new SpanTermQuery(new Term("base", "s:c"))));
@@ -89,7 +128,6 @@
 
     };
 
-
     @Test
     public void indexExample2 () throws IOException {
         KrillIndex ki = new KrillIndex();
@@ -118,7 +156,6 @@
 
     };
 
-
     @Test
     public void indexExample3 () throws IOException {
         KrillIndex ki = new KrillIndex();
@@ -146,7 +183,6 @@
         assertEquals("abc[[abcab]]ac", kr.getMatch(0).getSnippetBrackets());
     };
 
-
     @Test
     public void indexExample4 () throws IOException {
         KrillIndex ki = new KrillIndex();
@@ -203,7 +239,6 @@
         assertEquals("xb[[zxbzx]]bxz", kr.getMatch(0).getSnippetBrackets());
     };
 
-
     /**
      * Multiple atomic indices
      * Skip to a greater doc#
@@ -217,9 +252,9 @@
         ki.addDoc(createFieldDoc3());
         ki.commit();
 
-        SpanQuery sq = new SpanNextQuery(
-                new SpanTermQuery(new Term("base", "s:d")),
-                new SpanTermQuery(new Term("base", "s:b")));
+        SpanQuery sq =
+                new SpanNextQuery(new SpanTermQuery(new Term("base", "s:d")),
+                        new SpanTermQuery(new Term("base", "s:b")));
         Result kr = ki.search(sq, (short) 10);
 
         assertEquals("totalResults", kr.getTotalResults(), 2);
@@ -242,7 +277,6 @@
         assertEquals("EndPos", 4, kr.getMatch(0).endPos);
     }
 
-
     /** Skip to NextSpan */
     @Test
     public void indexExample6 () throws IOException {
@@ -252,10 +286,11 @@
         ki.addDoc(createFieldDoc3());
         ki.commit();
 
-        SpanQuery sq = new SpanNextQuery(
-                new SpanTermQuery(new Term("base", "s:c")),
-                new SpanNextQuery(new SpanTermQuery(new Term("base", "s:d")),
-                        new SpanTermQuery(new Term("base", "s:b"))));
+        SpanQuery sq =
+                new SpanNextQuery(new SpanTermQuery(new Term("base", "s:c")),
+                        new SpanNextQuery(
+                                new SpanTermQuery(new Term("base", "s:d")),
+                                new SpanTermQuery(new Term("base", "s:b"))));
 
         Result kr = ki.search(sq, (short) 10);
         assertEquals("totalResults", kr.getTotalResults(), 1);
@@ -286,7 +321,6 @@
         // }
     }
 
-
     @Test
     public void indexExample7Distances () throws Exception {
         KrillIndex ki = new KrillIndex();
@@ -307,7 +341,6 @@
         assertEquals("doc-number", "match-doc-3-p2-5", kr.getMatch(2).getID());
     };
 
-
     @Test
     public void indexExample8Distances () throws Exception {
         KrillIndex ki = new KrillIndex();
@@ -328,7 +361,6 @@
         assertEquals("doc-number", "match-doc-3-p3-6", kr.getMatch(2).getID());
     };
 
-
     @Test
     public void indexExample9 () throws IOException {
         KrillIndex ki = new KrillIndex();
@@ -348,14 +380,13 @@
         assertEquals(5, kr.getMatch(1).getEndPos());
     };
 
-
-	@Test
-	public void sequenceSkipBug () throws IOException {
-		KrillIndex ki = new KrillIndex();
+    @Test
+    public void sequenceSkipBug () throws IOException {
+        KrillIndex ki = new KrillIndex();
 
         ki.addDoc(createFieldDoc1());
-		ki.addDoc(createFieldDoc3());
-		ki.addDoc(createFieldDoc4());
+        ki.addDoc(createFieldDoc3());
+        ki.addDoc(createFieldDoc4());
         ki.addDoc(createFieldDoc5()); // match for 2
         ki.addDoc(createFieldDoc1());
         ki.addDoc(createFieldDoc3());
@@ -365,11 +396,11 @@
         ki.addDoc(createFieldDoc3());
         ki.addDoc(createFieldDoc1());
         ki.commit();
-		
-		ki.addDoc(createFieldDoc5()); // match for 2
+
+        ki.addDoc(createFieldDoc5()); // match for 2
         ki.addDoc(createFieldDoc1());
         ki.addDoc(createFieldDoc2()); // match for 1 and 2
-		ki.addDoc(createFieldDoc1());
+        ki.addDoc(createFieldDoc1());
         ki.addDoc(createFieldDoc3());
         ki.addDoc(createFieldDoc4());
         ki.addDoc(createFieldDoc1());
@@ -377,15 +408,11 @@
 
         ki.commit();
 
-		// "cab" is in 2
-        SpanQuery sq =
-			new SpanNextQuery(
-				new SpanNextQuery(
-					new SpanTermQuery(new Term("base", "s:c")),
-					new SpanTermQuery(new Term("base", "s:a"))
-					),
-                new SpanTermQuery(new Term("base", "s:b"))
-				);
+        // "cab" is in 2
+        SpanQuery sq = new SpanNextQuery(
+                new SpanNextQuery(new SpanTermQuery(new Term("base", "s:c")),
+                        new SpanTermQuery(new Term("base", "s:a"))),
+                new SpanTermQuery(new Term("base", "s:b")));
 
         Result kr = ki.search(sq, (short) 10);
 
@@ -393,19 +420,15 @@
         assertEquals(3, kr.getMatch(0).getEndPos());
         assertEquals("totalResults", kr.getTotalResults(), 1);
 
-		// "aba" is in 2 and 5
-		sq = new SpanNextQuery(
-			new SpanNextQuery(
-				new SpanTermQuery(new Term("base", "s:a")),
-				new SpanTermQuery(new Term("base", "s:b"))
-				),
-			new SpanTermQuery(new Term("base", "s:a"))
-			);
+        // "aba" is in 2 and 5
+        sq = new SpanNextQuery(
+                new SpanNextQuery(new SpanTermQuery(new Term("base", "s:a")),
+                        new SpanTermQuery(new Term("base", "s:b"))),
+                new SpanTermQuery(new Term("base", "s:a")));
 
         kr = ki.search(sq, (short) 10);
         assertEquals("totalResults", kr.getTotalResults(), 3);
-	};
-
+    };
 
     private FieldDocument createFieldDoc1 () {
         FieldDocument fd = new FieldDocument();
@@ -419,7 +442,6 @@
         return fd;
     }
 
-
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-1");
@@ -431,11 +453,10 @@
         return fd;
     }
 
-
     private FieldDocument createFieldDoc3 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
-        fd.addTV("base", "cdbd", //  c[ba]d
+        fd.addTV("base", "cdbd", // c[ba]d
                 "[(0-1)s:c|i:c|_0$<i>0<i>1]" + "[(1-2)s:d|i:d|_1$<i>1<i>2]"
                         + "[(2-3)s:b|i:b|s:a|_2$<i>2<i>3]"
                         + "[(3-4)s:d|i:d|_3$<i>3<i>4]");
@@ -443,7 +464,6 @@
         return fd;
     }
 
-
     private FieldDocument createFieldDoc4 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-3");
@@ -460,14 +480,11 @@
     private FieldDocument createFieldDoc5 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-4");
-        fd.addTV("base", "dabaca",
-                "[(0-1)s:d|i:d|_0$<i>0<i>1]"
-				 + "[(1-2)s:a|i:a|_1$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3<b>0]"
-				 + "[(2-3)s:b|i:b|_2$<i>2<i>3]"
-				 + "[(3-4)s:a|i:a|_3$<i>3<i>4]"
-				 + "[(4-5)s:c|i:c|_4$<i>4<i>5]"
-				 + "[(5-6)s:a|i:a|_5$<i>5<i>6]");
+        fd.addTV("base", "dabaca", "[(0-1)s:d|i:d|_0$<i>0<i>1]"
+                + "[(1-2)s:a|i:a|_1$<i>1<i>2|<>:e$<b>64<i>1<i>3<i>3<b>0]"
+                + "[(2-3)s:b|i:b|_2$<i>2<i>3]" + "[(3-4)s:a|i:a|_3$<i>3<i>4]"
+                + "[(4-5)s:c|i:c|_4$<i>4<i>5]" + "[(5-6)s:a|i:a|_5$<i>5<i>6]");
         return fd;
-    }	
+    }
 
 };
diff --git a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
index 488067d..8a78b62 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -1,9 +1,13 @@
 package de.ids_mannheim.korap.index;
 
 import static de.ids_mannheim.korap.TestSimple.getJsonString;
+import static de.ids_mannheim.korap.TestSimple.simpleFieldDoc;
 import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.regex.Pattern;
 
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.RegexpQuery;
@@ -16,9 +20,11 @@
 import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KrillIndex;
 import de.ids_mannheim.korap.KrillQuery;
+import de.ids_mannheim.korap.TestSimple;
 import de.ids_mannheim.korap.query.QueryBuilder;
 import de.ids_mannheim.korap.query.SpanElementQuery;
 import de.ids_mannheim.korap.query.SpanExpansionQuery;
+import de.ids_mannheim.korap.query.SpanNextQuery;
 import de.ids_mannheim.korap.query.SpanRepetitionQuery;
 import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
 import de.ids_mannheim.korap.response.Result;
@@ -29,26 +35,58 @@
     Result kr;
     KrillIndex ki;
 
-
     public TestSpanExpansionIndex () throws IOException {
         ki = new KrillIndex();
         ki.addDoc(getClass().getResourceAsStream("/wiki/00001.json.gz"), true);
         ki.commit();
     }
 
+    /** Method for finding bugs. Since java matcher cannot find multiple matches
+     * from the same offset, the expected results are sometimes lower than the 
+     * actual results. 
+     * 
+     * @throws IOException
+     * @throws QueryException
+     */
+    public void fuzzyTest () throws IOException, QueryException {
+        List<String> chars = Arrays.asList("a", "b", "c", "d", "e");
+
+        // c []{0,2} a
+        SpanTermQuery stq = new SpanTermQuery(new Term("base", "s:c"));
+        SpanTermQuery stq2 = new SpanTermQuery(new Term("base", "s:a"));
+        SpanExpansionQuery seq = new SpanExpansionQuery(stq, 0, 2, 0, true);
+        SpanNextQuery snq = new SpanNextQuery(seq, stq2);
+
+        Pattern resultPattern = Pattern.compile("c[a-e]{0,2}a");
+        TestSimple.fuzzingTest(chars, resultPattern, snq,
+                6, 20, 8,1);
+    }
+    
+    @Test
+    public void testNoExpansion () throws IOException {
+        KrillIndex ki = new KrillIndex();
+        ki.addDoc(simpleFieldDoc("cc"));
+        ki.commit();
+
+        SpanTermQuery stq = new SpanTermQuery(new Term("base", "s:c"));
+        SpanExpansionQuery seq = new SpanExpansionQuery(stq, 0, 0, 0, true);
+        Result kr = ki.search(seq, (short) 10);
+        
+        assertEquals(2, kr.getTotalResults());
+    }
 
     /**
      * Left and right expansions
      */
     @Test
-    public void testCase1 () throws IOException {
+    public void testLeftRightExpansions () throws IOException {
 
         SpanTermQuery stq = new SpanTermQuery(new Term("tokens", "s:des"));
         // left
         SpanExpansionQuery seq = new SpanExpansionQuery(stq, 0, 2, -1, true);
         kr = ki.search(seq, (short) 10);
 
-        //assertEquals(69,kr.getTotalResults());
+        // assertEquals(69,kr.getTotalResults());
         assertEquals(5, kr.getMatch(0).getStartPos());
         assertEquals(8, kr.getMatch(0).getEndPos());
         assertEquals(6, kr.getMatch(1).getStartPos());
@@ -57,9 +95,9 @@
         assertEquals(8, kr.getMatch(2).getEndPos());
 
         /*
-         * for (Match km : kr.getMatches()) {
-         * System.out.println(km.getStartPos() + "," + km.getEndPos() + " " +
-         * km.getSnippetBrackets()); }
+          for (Match km : kr.getMatches()) {
+          System.out.println(km.getStartPos() + "," + km.getEndPos() + " " +
+          km.getSnippetBrackets()); }
          */
 
         // right
@@ -76,13 +114,12 @@
         assertEquals(161, kr.getMatch(3).getEndPos());
     }
 
-
     /**
      * Classnumber
      * Check the expansion offsets
      */
     @Test
-    public void testCase2 () {
+    public void testExpansionWithClassNumber () {
         byte classNumber = 1;
         SpanExpansionQuery sq;
         // create new payload for the expansion offsets
@@ -135,12 +172,11 @@
          */
     }
 
-
     /**
      * Right expansion with exclusion
      */
     @Test
-    public void testCase3 () throws IOException {
+    public void testRightExpansionWithExclusion () throws IOException {
         byte classNumber = 1;
         SpanTermQuery stq = new SpanTermQuery(new Term("tokens", "tt/p:NN"));
         SpanTermQuery notQuery =
@@ -170,13 +206,12 @@
          */
     }
 
-
     /**
      * Left expansion with exclusion
      * No expansion
      */
     @Test
-    public void testCase4 () throws IOException {
+    public void testLeftExpansionWithExclusion () throws IOException {
         byte classNumber = 1;
         SpanTermQuery stq = new SpanTermQuery(new Term("tokens", "tt/p:NN"));
         SpanTermQuery notQuery =
@@ -212,7 +247,6 @@
 
     }
 
-
     /**
      * Expansion over start and end documents start => cut to 0
      * TODO: end => to be handled in rendering process
@@ -220,7 +254,7 @@
      * @throws IOException
      */
     @Test
-    public void testCase5 () throws IOException {
+    public void testExpansionOverStart () throws IOException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(createFieldDoc0());
         ki.commit();
@@ -234,7 +268,7 @@
         assertEquals(0, kr.getMatch(0).getStartPos());
         assertEquals(2, kr.getMatch(0).getEndPos());
 
-        //right expansion exceeds end position
+        // right expansion exceeds end position
         seq = new SpanExpansionQuery(stq, 3, 3, 0, true);
         kr = ki.search(seq, (short) 10);
 
@@ -251,14 +285,13 @@
          */
     }
 
-
     /**
      * Expansion exclusion : multiple documents
      * 
      * @throws IOException
      */
     @Test
-    public void testCase6 () throws IOException {
+    public void testExclusionWithMultipleDocs () throws IOException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(createFieldDoc0()); // same doc
         ki.addDoc(createFieldDoc1()); // only not clause
@@ -283,22 +316,22 @@
         assertEquals(4, kr.getMatch(4).getEndPos());
     }
 
-
     /**
      * Skip to
      */
     @Test
-    public void testCase7 () throws IOException, QueryException {
+    public void testExpansionWithSkipTo () throws IOException, QueryException {
         KrillIndex ki = new KrillIndex();
         ki.addDoc(getClass().getResourceAsStream("/wiki/00001.json.gz"), true);
         ki.addDoc(getClass().getResourceAsStream("/wiki/00002.json.gz"), true);
         ki.commit();
-        String jsonPath = getClass().getResource("/queries/poly3.json").getFile();
+        String jsonPath =
+                getClass().getResource("/queries/poly3.json").getFile();
         String jsonQuery = getJsonString(jsonPath);
         SpanQueryWrapper sqwi = new KrillQuery("tokens").fromKoral(jsonQuery);
 
         SpanQuery sq = sqwi.toQuery();
-        //System.out.println(sq.toString());
+        // System.out.println(sq.toString());
         kr = ki.search(sq, (short) 20);
 
         assertEquals(205, kr.getMatch(0).getStartPos());
@@ -311,7 +344,6 @@
          */
     }
 
-
     /**
      * Query rewrite bug
      * 
@@ -378,8 +410,6 @@
         assertEquals((long) 2, kr.getTotalResults());
     }
 
-
-
     /**
      * Query rewrite bug
      * 
@@ -416,7 +446,6 @@
         assertEquals(2, kr.getTotalResults());
     }
 
-
     @Test
     public void indexRegexSequence () throws Exception {
         KrillIndex ki = new KrillIndex();
@@ -428,7 +457,6 @@
         SpanQueryWrapper sq = kq.seq(kq.or("s:baumgarten", "s:steingarten"))
                 .append(kq.seg().without(kq.or("s:franz", "s:hans")));
 
-
         // Expected to find [baumgarten steingarten]
         Krill ks = _newKrill(sq);
         Result kr = ki.search(ks);
@@ -459,7 +487,7 @@
         ki.commit();
 
         SpanTermQuery stq = new SpanTermQuery(new Term("base", "s:a"));
-        
+
         RegexpQuery requery =
                 new RegexpQuery(new Term("base", "s:[bc]"), RegExp.ALL);
         SpanMultiTermQueryWrapper<RegexpQuery> notQuery =
@@ -472,10 +500,9 @@
 
         kr = ki.search(seq, (short) 20);
 
-        assertEquals(9,kr.getMatches().size());
-        
-    }
+        assertEquals(9, kr.getMatches().size());
 
+    }
 
     @Test
     public void indexExpansionWithNegationDifferentFragments () throws Exception {
@@ -540,7 +567,6 @@
         assertEquals((long) 1, kr.getTotalResults());
     };
 
-    
     private FieldDocument createFieldDoc6 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-6");
@@ -580,7 +606,6 @@
         return fd;
     }
 
-
     private FieldDocument createFieldDoc2 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
@@ -592,7 +617,6 @@
         return fd;
     }
 
-
     private FieldDocument createFieldDoc3 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-3");
@@ -602,7 +626,6 @@
         return fd;
     }
 
-
     private FieldDocument createFieldDoc4 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-4");
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKrill.java b/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
index 1d993b8..7094199 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKrill.java
@@ -895,7 +895,7 @@
                         + "(tokens:/tt/p:A.*/){1,3}), "
                         + "SpanMultiTermQueryWrapper(tokens:/tt/p:N.*/))])");
 
-        assertEquals(kr.getTotalResults(), 58);
+        assertEquals(68,kr.getTotalResults());
         assertEquals(0, kr.getStartIndex());
 
         assertEquals(kr.getMatch(0).getSnippetBrackets(),
@@ -908,10 +908,9 @@
         assertEquals(kr.getMatch(3).getSnippetBrackets(),
                 "Saragat-Partei zerfällt Rom ([[ADN]]) "
                         + "die von dem Rechtssozialisten Saragat geführte ...");
-        assertEquals(kr.getMatch(23).getSnippetBrackets(),
-                "... dem Namen \"Einheitsbewegung der sozialistischen "
-                        + "Initiative\" [[eine neue politische Gruppierung]] "
-                        + "ins Leben gerufen hatten. Pressemeldungen zufolge ...");
+        assertEquals("... auseinander, nachdem vor einiger Zeit mehrere "
+                + "[[prominente Mitglieder]] ihren Austritt erklärt "
+                + "und unter dem ...", kr.getMatch(23).getSnippetBrackets());
     };
 
 
