diff --git a/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedSpans.java b/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedSpans.java
index 245df4d..3fd0afe 100644
--- a/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedSpans.java
+++ b/src/main/java/de/ids_mannheim/korap/query/spans/ExpandedSpans.java
@@ -41,11 +41,13 @@
 	public boolean next() throws IOException {
 		matchPayload.clear();
 		isStartEnumeration = false;
+		if (candidateSpans.size() == 0 && hasMoreSpans)
+			hasMoreSpans = firstSpans.next();
 		return advance();
 	}
 
 	private boolean advance() throws IOException {		
-		while (candidateSpans.size() > 0 || (hasMoreSpans = firstSpans.next())) {
+		while (candidateSpans.size() > 0 || hasMoreSpans) {
 			if (candidateSpans.size() > 0 ){
 				setMatch(candidateSpans.get(0));
 				candidateSpans.remove(0);								
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 6173ad6..0a90445 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -2,9 +2,12 @@
 
 import static org.junit.Assert.*;
 
+import java.io.BufferedReader;
+import java.io.FileReader;
 import java.io.IOException;
 
 import org.apache.lucene.index.Term;
+import org.apache.lucene.search.spans.SpanQuery;
 import org.apache.lucene.search.spans.SpanTermQuery;
 import org.apache.lucene.search.spans.SpanMultiTermQueryWrapper;
 import org.apache.lucene.util.automaton.RegExp;
@@ -14,10 +17,13 @@
 
 import de.ids_mannheim.korap.KorapIndex;
 import de.ids_mannheim.korap.KorapMatch;
+import de.ids_mannheim.korap.KorapQuery;
 import de.ids_mannheim.korap.KorapResult;
 import de.ids_mannheim.korap.query.SpanElementQuery;
 import de.ids_mannheim.korap.query.SpanExpansionQuery;
 import de.ids_mannheim.korap.query.SpanRepetitionQuery;
+import de.ids_mannheim.korap.query.wrap.SpanQueryWrapper;
+import de.ids_mannheim.korap.util.QueryException;
 
 public class TestSpanExpansionIndex {
 
@@ -253,6 +259,37 @@
         assertEquals(1, kr.getMatch(4).getStartPos());
         assertEquals(4, kr.getMatch(4).getEndPos());		
 	}
+	
+	/** Skip to
+	 * */
+	@Test
+	public void testCase7() throws IOException, QueryException{
+		KorapIndex ki = new KorapIndex();
+		ki.addDocFile(
+		    	getClass().getResource("/wiki/00001.json.gz").getFile(),true);		
+		ki.addDocFile(
+		    	getClass().getResource("/wiki/00002.json.gz").getFile(),true);
+		ki.commit();
+		
+		String jsonPath = getClass().getResource("/queries/poly3.json").getFile();
+		String jsonQuery = readFile(jsonPath);
+		SpanQueryWrapper sqwi = new KorapQuery("tokens").fromJSON(
+				jsonQuery
+		);
+		
+		SpanQuery sq = sqwi.toQuery();
+		//System.out.println(sq.toString());
+		kr = ki.search(sq, (short) 20);
+		
+		assertEquals(205, kr.getMatch(0).getStartPos());
+        assertEquals(208, kr.getMatch(0).getEndPos());
+		
+		/*for (KorapMatch km : kr.getMatches()){
+			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
+					+km.getSnippetBrackets()
+			);
+		}*/
+	}
 
 
     /** 
@@ -261,29 +298,31 @@
      * */
     @Test
     public void testQueryRewriteBug() throws IOException {
-	KorapIndex ki = new KorapIndex();
-	ki.addDoc(createFieldDoc0()); // same doc
-	ki.addDoc(createFieldDoc1()); // only not clause
-	ki.addDoc(createFieldDoc2()); // only main clause
-	ki.commit();
-
-	// See /queries/bugs/repetition_group_rewrite
-	// spanRepetition(spanExpansion(
-	//     SpanMultiTermQueryWrapper(tokens:/cnx/p:A/), []{1, 1}, right){2,2}
-        // )
-	RegexpQuery requery = new RegexpQuery(new Term("base", "s:[ac]"), RegExp.ALL);
-	SpanMultiTermQueryWrapper<RegexpQuery> query =
-	    new SpanMultiTermQueryWrapper<RegexpQuery>( requery );
-	SpanExpansionQuery seq  = new SpanExpansionQuery(query, 1, 1, 1, true);		
-	SpanRepetitionQuery rep = new SpanRepetitionQuery(seq, 2, 2, true);
+		KorapIndex ki = new KorapIndex();
+		ki.addDoc(createFieldDoc0()); // same doc
+		ki.addDoc(createFieldDoc1()); // only not clause
+		ki.addDoc(createFieldDoc2()); // only main clause
+		ki.commit();
 	
-	try {
-	    ki.search(rep, (short) 20);
-	}
-	catch (Exception e) {
-	    fail(e.getMessage());
-	};
-    };
+		// See /queries/bugs/repetition_group_rewrite
+		// spanRepetition(spanExpansion(
+		//     SpanMultiTermQueryWrapper(tokens:/cnx/p:A/), []{1, 1}, right){2,2}
+	        // )
+		RegexpQuery requery = new RegexpQuery(new Term("base", "s:[ac]"), RegExp.ALL);
+		SpanMultiTermQueryWrapper<RegexpQuery> query =
+		    new SpanMultiTermQueryWrapper<RegexpQuery>( requery );
+		SpanExpansionQuery seq  = new SpanExpansionQuery(query, 1, 1, 1, true);		
+		SpanRepetitionQuery rep = new SpanRepetitionQuery(seq, 2, 2, true);
+		
+		kr = ki.search(rep, (short) 20);
+		assertEquals(3,kr.getTotalResults());
+		
+		/*for (KorapMatch km : kr.getMatches()){
+			System.out.println(km.getStartPos() +","+km.getEndPos()+" "
+					+km.getSnippetBrackets()
+			);
+		}*/
+    }
 
 	
 	private FieldDocument createFieldDoc0(){
@@ -309,12 +348,12 @@
         fd.addString("ID", "doc-1");
         fd.addTV("base",
             "bbccdd",             
-            "[(0-1)s:b|s:c|_1#0-1]" +
-            "[(1-2)s:b|_2#1-2]" +             
-            "[(2-3)s:c|_3#2-3]" +
-            "[(3-4)s:c|_4#3-4]" + 
-            "[(4-5)s:d|_5#4-5]" +             
-            "[(5-6)s:d|_6#5-6]");
+            "[(0-1)s:b|s:c|_0#0-1]" +
+            "[(1-2)s:b|_1#1-2]" +             
+            "[(2-3)s:c|_2#2-3]" +
+            "[(3-4)s:c|_3#3-4]" + 
+            "[(4-5)s:d|_4#4-5]" +             
+            "[(5-6)s:d|_5#5-6]");
         return fd;
 	}
 	
@@ -322,13 +361,28 @@
     	FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-2");
         fd.addTV("base",
-            "text",             
-            "[(0-1)s:b|s:c|_1#0-1]" +
-            "[(1-2)s:e|_2#1-2]" +             
-            "[(2-3)s:c|_3#2-3]" +
-            "[(3-4)s:c|_4#3-4]" + 
-            "[(4-5)s:e|_5#4-5]" +             
-            "[(5-6)s:a|_6#5-6]");
+            "beccea",             
+            "[(0-1)s:b|s:c|_0#0-1]" +
+            "[(1-2)s:e|_1#1-2]" +             
+            "[(2-3)s:c|_2#2-3]" +
+            "[(3-4)s:c|_3#3-4]" + 
+            "[(4-5)s:e|_4#4-5]" +             
+            "[(5-6)s:a|_5#5-6]");
         return fd;
 	}
+	
+	private String readFile(String path) {
+		StringBuilder sb = new StringBuilder();
+		try {
+		    BufferedReader in = new BufferedReader(new FileReader(path));
+		    String str;
+		    while ((str = in.readLine()) != null) {
+		    	sb.append(str);
+		    };
+		    in.close();
+		} catch (IOException e) {
+		    fail(e.getMessage());
+		}
+		return sb.toString();
+	}
 }
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java b/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
index f8a2963..5120bab 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestTemporaryQueryLimitations.java
@@ -1,4 +1,6 @@
-package de.ids_mannheim.korap.highlight;
+package de.ids_mannheim.korap.query;
+
+//package de.ids_mannheim.korap.highlight;
 
 import java.util.*;
 import java.io.IOException;
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java b/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
index 180d3ce..8765457 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
@@ -943,82 +943,84 @@
      */
     @Test
     public void searchJSONexpansionBug () throws IOException {
-	// Construct index
-	KorapIndex ki = new KorapIndex();
-	// Indexing test files
-	ki.addDocFile(
-	  getClass().getResource("/wiki/00002.json.gz").getFile(), true
-	);
-	ki.commit();
-
-	// Expansion bug
-	// der alte Digraph Aa durch Å
-	String json = getString(
-            getClass().getResource("/queries/bugs/expansion_bug_2.jsonld").getFile()
-        );
-
-	KorapResult kr = new KorapSearch(json).run(ki);
-	assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
-		     "[der alte Digraph Aa durch Å] ersetzt worden, " +
-		     "in Eigennamen und Ortsnamen ...",
-		     kr.getMatch(0).getSnippetBrackets());
-	assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
-	assertEquals(1, kr.getTotalResults());
-
-	// der alte Digraph Aa durch []
-	// Works with one document
-	json = getString(
-            getClass().getResource("/queries/bugs/expansion_bug.jsonld").getFile()
-        );
-
-	kr = new KorapSearch(json).run(ki);
-	assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
-		     "[der alte Digraph Aa durch Å] ersetzt worden, " +
-		     "in Eigennamen und Ortsnamen ...",
-		     kr.getMatch(0).getSnippetBrackets());
-	assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
-	assertEquals(1, kr.getTotalResults());
-
-	// Now try with one file ahead
-	ki = new KorapIndex();
-	for (String i : new String[] {"00001",
-				      "00002"}) {
-	    ki.addDocFile(
-	      getClass().getResource("/wiki/" + i + ".json.gz").getFile(), true
-            );
-	};
-	ki.commit();
-
-	// Expansion bug
-	// der alte Digraph Aa durch Å
-	json = getString(
-            getClass().getResource("/queries/bugs/expansion_bug_2.jsonld").getFile()
-        );
-
-	kr = new KorapSearch(json).run(ki);
-	assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
-		     "[der alte Digraph Aa durch Å] ersetzt worden, " +
-		     "in Eigennamen und Ortsnamen ...",
-		     kr.getMatch(0).getSnippetBrackets());
-	assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
-	assertEquals(1, kr.getTotalResults());
-
-	// der alte Digraph Aa durch []
-	json = getString(
-            getClass().getResource("/queries/bugs/expansion_bug.jsonld").getFile()
-        );
-
-	kr = new KorapSearch(json).run(ki);
-
-	if (kr.getTotalResults() != 1)
-	    fail("Expansion fails");
-
-	assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
-		     "[der alte Digraph Aa durch Å] ersetzt worden, " +
-		     "in Eigennamen und Ortsnamen ...",
-		     kr.getMatch(0).getSnippetBrackets());
-	assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
-	assertEquals(1, kr.getTotalResults());
+		// Construct index
+		KorapIndex ki = new KorapIndex();
+		// Indexing test files
+		ki.addDocFile(
+		  getClass().getResource("/wiki/00002.json.gz").getFile(), true
+		);
+		ki.commit();
+	
+		// Expansion bug
+		// der alte Digraph Aa durch Å
+		String json = getString(
+	            getClass().getResource("/queries/bugs/expansion_bug_2.jsonld").getFile()
+	        );
+	
+		KorapResult kr = new KorapSearch(json).run(ki);				
+		assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
+			     "[der alte Digraph Aa durch Å] ersetzt worden, " +
+			     "in Eigennamen und Ortsnamen ...",
+			     kr.getMatch(0).getSnippetBrackets());
+		assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
+		assertEquals(1, kr.getTotalResults());
+	
+		// der alte Digraph Aa durch []
+		// Works with one document
+		json = getString(
+	            getClass().getResource("/queries/bugs/expansion_bug.jsonld").getFile()
+	        );
+	
+		kr = new KorapSearch(json).run(ki);
+		
+		assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
+			     "[der alte Digraph Aa durch Å] ersetzt worden, " +
+			     "in Eigennamen und Ortsnamen ...",
+			     kr.getMatch(0).getSnippetBrackets());
+		assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
+		assertEquals(1, kr.getTotalResults());
+	
+		// Now try with one file ahead
+		ki = new KorapIndex();
+		for (String i : new String[] {"00001",
+					      "00002"}) {
+		    ki.addDocFile(
+		      getClass().getResource("/wiki/" + i + ".json.gz").getFile(), true
+	            );
+		};
+		ki.commit();
+	
+		// Expansion bug
+		// der alte Digraph Aa durch Å
+		json = getString(
+	            getClass().getResource("/queries/bugs/expansion_bug_2.jsonld").getFile()
+	        );
+	
+		kr = new KorapSearch(json).run(ki);
+		
+		assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
+			     "[der alte Digraph Aa durch Å] ersetzt worden, " +
+			     "in Eigennamen und Ortsnamen ...",
+			     kr.getMatch(0).getSnippetBrackets());
+		assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
+		assertEquals(1, kr.getTotalResults());
+	
+		// der alte Digraph Aa durch []
+		json = getString(
+	            getClass().getResource("/queries/bugs/expansion_bug.jsonld").getFile()
+	        );
+	
+		kr = new KorapSearch(json).run(ki);
+		System.out.println(kr.getQuery());
+//		if (kr.getTotalResults() != 1)
+//		    fail("Expansion fails");
+	
+		assertEquals("... Buchstabe des Alphabetes. In Dänemark ist " +
+			     "[der alte Digraph Aa durch Å] ersetzt worden, " +
+			     "in Eigennamen und Ortsnamen ...",
+			     kr.getMatch(0).getSnippetBrackets());
+		assertEquals("WPD_AAA.00002", kr.getMatch(0).getDocID());
+		assertEquals(1, kr.getTotalResults());
     };
 
 
diff --git a/src/test/resources/queries/poly3.json b/src/test/resources/queries/poly3.json
new file mode 100644
index 0000000..45492c7
--- /dev/null
+++ b/src/test/resources/queries/poly3.json
@@ -0,0 +1,45 @@
+{
+   "@context" : "http://ids-mannheim.de/ns/KorAP/json-ld/v0.2/context.jsonld",
+   "collection" : {},
+   "collections" : [
+      {
+         "@type" : "korap:meta-filter",
+         "@value" : {
+            "@field" : "korap:field#corpusID",
+            "@type" : "korap:term",
+            "@value" : "WPD"
+         }
+      }
+   ],
+   "errors" : [],
+   "messages" : [],
+   "meta" : {},
+   "query" : {
+      "@type" : "korap:group",
+      "operands" : [
+         {
+            "@type" : "korap:token",
+            "wrap" : {
+               "@type" : "korap:term",
+               "key" : "Aa",
+               "layer" : "orth",
+               "match" : "match:eq"
+            }
+         },
+         {
+            "@type" : "korap:token",
+            "wrap" : {
+               "@type" : "korap:term",
+               "key" : "durch",
+               "layer" : "orth",
+               "match" : "match:eq"
+            }
+         },
+         {
+            "@type" : "korap:token"
+         }
+      ],
+      "operation" : "operation:sequence"
+   },
+   "warnings" : []
+}
\ No newline at end of file
