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..d630dfc 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 = "";
@@ -84,7 +103,7 @@
         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 +208,52 @@
         };
         return spanArray;
     };
+    
+    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 = "";
+
+        // Create fuzzy corpora (1000 trials)
+        for (int x = 0; x < 100000; x++) {
+            KrillIndex ki = new KrillIndex();
+            ArrayList<String> list = new ArrayList<String>();
+            int c = 0;
+
+            // Create a corpus of 8 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();
+                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());
     };
 
 
