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 eb3641f..ecdafc0 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
@@ -95,7 +95,8 @@
                 return true;
             }
             else {
-                setCandidateList(firstSpans.end());
+                setCandidateList();
+//                log.debug(candidateSpans.toString());
             }
         }
         return false;
@@ -107,14 +108,9 @@
      * all possible expansion with respect to the expansion length
      * (min,max) variables.
      * 
-     * @param lastPosition
-     *            is used in left expansion. The start position of
-     *            the candidates to collect must not beyond this
-     *            position.
-     * 
      * @throws IOException
      */
-    private void setCandidateList (int lastPosition) throws IOException {
+    private void setCandidateList () throws IOException {
         CandidateSpan cs;
         int counter, start, end;
 
@@ -130,10 +126,12 @@
                 counter--;
             }
             
+            int lastPosition = firstSpans.start();
             if (hasMoreSpans && (hasMoreSpans = firstSpans.next()) ) {
                 start = Math.max(0, firstSpans.start() - max);
+                log.debug("next candidate start: "+start+", lastPosition "+lastPosition);
                 if (start <= lastPosition) {
-                    setCandidateList(lastPosition);
+                    setCandidateList();
                 }
             }
         }
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 fc915c8..5e21d39 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
@@ -114,9 +114,11 @@
                 matchList.remove(0);
                 return true;
             }
+            
             // Forward firstspan
             hasMoreFirstSpan = firstSpans.next();
             if (hasMoreFirstSpan){
+                log.debug("FirstSpan "+firstSpans.start() +","+firstSpans.end());
                 setMatchList();
             }
             else {
@@ -170,6 +172,7 @@
      * @throws IOException
      */
     private void searchCandidates () throws IOException {
+        log.debug(candidateList.toString());
         Iterator<CandidateSpan> i = candidateList.iterator();
         CandidateSpan cs;
         while (i.hasNext()) {
@@ -200,6 +203,7 @@
     private void searchMatches () throws IOException {
 
         while (hasMoreSpans && candidateListDocNum == secondSpans.doc()) {
+            log.debug("SecondSpan " +secondSpans.start() + "," + secondSpans.end());
             if (secondSpans.start() > firstSpans.end()) {
                 break;
             }
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 edfc875..9ab5c62 100644
--- a/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/index/TestSpanExpansionIndex.java
@@ -637,6 +637,22 @@
         assertEquals(18, kr.getTotalResults());        
     }
     
+    public void testLeftExpansionWrongSorting () throws IOException {
+        KrillIndex ki = new KrillIndex();
+        ki.addDoc(simpleFieldDoc("B u d B R a d m d Z z s B d v", " "));
+        ki.commit();
+        
+        SpanTermQuery stq = new SpanTermQuery(new Term("base", "s:d"));
+        SpanExpansionQuery seq = new SpanExpansionQuery(stq, 0, 8, -1, true);
+        
+        Result kr = ki.search(seq, (short) 25);
+//        for (Match km : kr.getMatches()){
+//             System.out.println(km.getStartPos() +","+km.getEndPos()+" "
+//             +km.getSnippetBrackets()); }
+        // 2-3, 6-7, 8-9, 13-14
+        assertEquals("BudBR[[admdZzsBd]]v", kr.getMatch(15).getSnippetBrackets());
+        assertEquals(28, kr.getTotalResults());
+    }
     
     /** Tests left expansion over start doc boundary. Redundant matches should
      *  be omitted.
@@ -659,6 +675,7 @@
 
     }
     
+    
     private FieldDocument createFieldDoc6 () {
         FieldDocument fd = new FieldDocument();
         fd.addString("ID", "doc-6");
