Fixed select menu
diff --git a/dev/demo/match.html b/dev/demo/match.html
index d586959..e00e1d2 100644
--- a/dev/demo/match.html
+++ b/dev/demo/match.html
@@ -25,17 +25,26 @@
   <body>
     <div id="search">
       <ol class="align-left">
-	<li data-corpus-id="WPD"
-	    data-doc-id="WWW"
-	    data-text-id="03313"
-	    data-match-id="p102-103"
-	    data-available-info="base/s=spans corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans"
-	    id="WPD-WWW.03313-p102-103">
-	  <div>
-	    <div class="snippet startMore endMore"><span class="context-left">In diesem Beispiel ist zu sehen, dass die beiden Variablen a und b lediglich ihre Werte an die Funktion </span><span class="match">test</span><span class="context-right"> übergeben, aber im Gegensatz zu einem Referenzparamter dabei unverändert bleiben.</span></div>
-	  </div>
-	  <p class="ref"><strong>Wertparameter</strong> by Hubi,Zwobot,4; published on 2005-03-28 as WWW.03313 (WPD)</p>
-	</li>
+	      <li data-corpus-id="WPD"
+	          data-doc-id="WWW"
+	          data-text-id="03313"
+	          data-match-id="p102-103"
+	          data-available-info="base/s=spans corenlp/c=spans corenlp/ne=tokens corenlp/p=tokens corenlp/s=spans glemm/l=tokens mate/l=tokens mate/m=tokens mate/p=tokens opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans"
+	          id="WPD-WWW.03313-p102-103">
+	        <div>
+	          <div class="snippet startMore endMore"><span class="context-left">In diesem Beispiel ist zu sehen, dass die beiden Variablen a und b lediglich ihre Werte an die Funktion </span><span class="match">test</span><span class="context-right"> übergeben, aber im Gegensatz zu einem Referenzparamter dabei unverändert bleiben.</span></div>
+	        </div>
+	        <p class="ref"><strong>Wertparameter</strong> by Hubi,Zwobot,4; published on 2005-03-28 as WWW.03313 (WPD)</p>
+	      </li>
+        <li data-match-id="p15845-15846"
+            data-text-sigle="GOE/AGI/00000"
+            data-available-info="base/s=spans corenlp/c=spans corenlp/p=tokens corenlp/s=spans dereko/s=spans malt/d=rels opennlp/p=tokens opennlp/s=spans tt/l=tokens tt/p=tokens tt/s=spans" data-info="{&quot;UID&quot;:0,&quot;author&quot;:&quot;Goethe, Johann Wolfgang von&quot;,&quot;corpusID&quot;:null,&quot;corpusSigle&quot;:&quot;GOE&quot;,&quot;docID&quot;:null,&quot;docSigle&quot;:&quot;GOE\/AGI&quot;,&quot;layerInfos&quot;:&quot;base\/s=spans corenlp\/c=spans corenlp\/p=tokens corenlp\/s=spans dereko\/s=spans malt\/d=rels opennlp\/p=tokens opennlp\/s=spans tt\/l=tokens tt\/p=tokens tt\/s=spans&quot;,&quot;matchID&quot;:&quot;p15845-15846&quot;,&quot;pubDate&quot;:&quot;1982&quot;,&quot;pubPlace&quot;:&quot;München&quot;,&quot;subTitle&quot;:&quot;Auch ich in Arkadien!&quot;,&quot;textID&quot;:null,&quot;textSigle&quot;:&quot;GOE\/AGI\/00000&quot;,&quot;title&quot;:&quot;Italienische Reise&quot;}"
+            id="GOE/AGI/00000#p15845-15846">
+          <div>
+            <div class="flag"></div>
+            <div class="snippet startMore endMore"><span class="context-left"><span class="more"></span>in Wolken halb versteckt, an die sich in Nordwest die vicentinischen anschließen, endlich gegen Westen die näheren Gebirge von Este, deren Gestalten und Vertiefungen man deutlich sehen kann. gegen Südost ein grünes Pflanzenmeer, ohne eine Spur von Erhöhung, Baum an </span><span class="match"><mark>Baum</mark></span><span class="context-right">, Busch an Busch, Pflanzung an Pflanzung, unzählige weiße Häuser, Villen und Kirchen aus dem Grünen hervorblickend. am Horizont sah ich ganz deutlich den Markusturm zu Venedig und andere geringere Türme. endlich habe ich die Werke des Palladio erlangt, zwar nicht<span class="more"></span></span></div>
+          </div>
+          <p class="ref"><strong>Italienische Reise</strong> von Goethe, Johann Wolfgang von (<time datetime="1982">1982</time>)  <span class="sigle">[GOE/AGI/00000]</span> </p>
       </ol>
     </div>
   </body>
diff --git a/dev/demo/matchdemo.js b/dev/demo/matchdemo.js
index 9d2d915..f5a1b96 100644
--- a/dev/demo/matchdemo.js
+++ b/dev/demo/matchdemo.js
@@ -111,6 +111,7 @@
 //  var treeSnippet = "<span class=\"context-left\"><\/span><span class=\"match\">In diesem <span title=\"cnx\/c:np\">Sinne<\/span> schrieb <span title=\"cnx\/c:np\">Brunschwicg<\/span>:&quot;In <span title=\"cnx\/c:np\">Euklids<\/span> <span title=\"cnx\/c:np\">Elementen<\/span> <span title=\"cnx\/c:np\">spiegel<\/span> sich die <span title=\"cnx\/c:np\">Resultate<\/span> der <span title=\"cnx\/c:np\">Arbeit von Generationen vor Aristoteles<\/span> wider, nicht nur die <span title=\"cnx\/c:np\">technische Arbeit<\/span> der <span title=\"cnx\/c:np\">Entdecklung<\/span>, sondern auch die <span title=\"cnx\/c:np\">methodologische Arbeit<\/span> der <span title=\"cnx\/c:np\">Verbindung<\/span> und des <span title=\"cnx\/c:np\">Beweises<\/span>, die, in der <span title=\"cnx\/c:np\">Schule<\/span> des <span title=\"cnx\/c:np\">Phythagoras<\/span> begonnen, ihre <span title=\"cnx\/c:np\">Vollendung in den Schulen von Eudoxos von Cnidus<\/span> und <span title=\"cnx\/c:np\">Platon<\/span> gefunden hat&quot;(5<\/span><span class=\"context-right\"><\/span>";
 
   KorAP.API.getMatchInfo = function(match, callObj, cb) {
+    console.dir(callObj);
     if (callObj["spans"] !== undefined && callObj["spans"] === true) {
       return cb({ "snippet": treeSnippet });
     }
diff --git a/dev/demo/menu.html b/dev/demo/menu.html
index bbed401..4401d87 100644
--- a/dev/demo/menu.html
+++ b/dev/demo/menu.html
@@ -28,7 +28,7 @@
       <select name="ql">
 	<option value="poliqarp">Poliqarp</option>
 	<option value="cosmas2">Cosmas 2</option>
-	<option value="annis">Annis QL</option>
+	<option value="annis" selected>Annis QL</option>
 	<option value="cql">CQL</option>
       </select>
     </span>
diff --git a/dev/demo/menudemo.js b/dev/demo/menudemo.js
index 3d67a14..a2571cb 100644
--- a/dev/demo/menudemo.js
+++ b/dev/demo/menudemo.js
@@ -150,6 +150,8 @@
   menu.limit(3).show(3);
   menu.focus();
 
+/*
   selectMenuClass.create(document.getElementById('choose-ql')).limit(5); // .show();
   largeMenu.limit(8).show(3);
+*/
 });
diff --git a/dev/js/spec/selectMenuSpec.js b/dev/js/spec/selectMenuSpec.js
index 5f0c909..26cfd25 100644
--- a/dev/js/spec/selectMenuSpec.js
+++ b/dev/js/spec/selectMenuSpec.js
@@ -54,6 +54,27 @@
         // TODO: Improve lcfield!!!!!!
 	      expect(menu.shownItem(0).lcField()).toEqual(' poliqarp');
       });
+
+      it('should first show the selected value', function () {
+	      var div = document.createElement('div');
+	      var element = div.appendChild(document.createElement('select'));
+	      for (i in list) {
+	        var opt = element.appendChild(document.createElement('option'));
+	        opt.setAttribute('value', list[i].value);
+	        opt.appendChild(document.createTextNode(list[i].content));
+	      };
+
+        expect(element.selectedIndex).toEqual(0);
+
+        // Select annis
+        element.children[2].selected = true;
+
+        expect(element.selectedIndex).toEqual(2);
+        
+	      var menu = selectMenuClass.create(div);
+        menu.show(3);
+        expect(menu._title.textContent).toEqual('Annis');
+      });
     });
   }
 );
diff --git a/dev/js/src/api.js b/dev/js/src/api.js
index c03013f..5295b3c 100644
--- a/dev/js/src/api.js
+++ b/dev/js/src/api.js
@@ -28,7 +28,7 @@
 
     // This is for legacy support
     var legacy = legacySigle.exec(match.textSigle);
-    if (legacy[0]) {
+    if (legacy !== null && legacy[0]) {
       url += '/' + legacy[1] + '/' + legacy[2] + '/' + legacy[3];
     }
     else {
diff --git a/dev/js/src/selectMenu.js b/dev/js/src/selectMenu.js
index d8db4cd..dc0f863 100644
--- a/dev/js/src/selectMenu.js
+++ b/dev/js/src/selectMenu.js
@@ -36,7 +36,7 @@
 	          ._init(list, {
 	            itemClass : selectMenuItemClass
 	          });
-
+        
 	      obj._container = element;
 	      obj._select = select;
 	      obj._select.style.display = 'none';
@@ -67,7 +67,6 @@
 	        this.showTitle();
 	      }.bind(obj));
 
-        // Show the title
 	      obj.showTitle();
 	      return obj;
       },
@@ -81,7 +80,7 @@
 	        this._select.selectedIndex = index;
 	      };
 
-	      return this._selected || 0;
+	      return this._selected || this._select.selectedIndex || 0;
       },
 
       /**
diff --git a/lib/Kalamar/API.pm b/lib/Kalamar/API.pm
index 07047de..84e208e 100644
--- a/lib/Kalamar/API.pm
+++ b/lib/Kalamar/API.pm
@@ -517,7 +517,8 @@
 # Cleanup single match
 sub _map_match {
   my $x = shift or return;
-  $x->{matchID} =~ s/^match\-(?:[^!]+!|[^_]+_)[^\.]+?\.[^-]+?-//;
+  $x->{matchID} =~ s/^match\-(?:[^!]+!|[^_]+_)[^\.]+?\.[^-]+?-// or
+    $x->{matchID} =~ s!^match\-(?:[^\/]+\/){2}[^-]+?-!!;
 
   (
     $x->{corpusID},
diff --git a/package.json b/package.json
index 549ec13..bb147e4 100755
--- a/package.json
+++ b/package.json
@@ -1,6 +1,7 @@
 {
   "name": "Kalamar",
   "description": "Mojolicious-based Frontend for KorAP",
+  "license" : "BSD-2-Clause",
   "version": "0.21.0",
   "repository" : {
     "type": "git",