diff --git a/dev/js/spec/menuSpec.js b/dev/js/spec/menuSpec.js
index 7577c2f..d1dcbe9 100644
--- a/dev/js/spec/menuSpec.js
+++ b/dev/js/spec/menuSpec.js
@@ -1428,6 +1428,19 @@
   });
 
   describe('KorAP.Slider', function () {
+
+    var demolonglist = [
+      ['Titel', 'title'],
+      ['Untertitel', 'subTitle'],
+      ['Veröffentlichungsdatum', 'pubDate'],
+      ['Länge', 'length'],
+      ['Autor', 'author'],
+      ['Genre', 'genre'],
+      ['corpusID', 'corpusID'],
+      ['docID', 'docID'],
+      ['textID', 'textID'],
+    ];
+
     it('should correctly be initializable', function () {
       var list = [
 	["Constituency"],
@@ -1505,6 +1518,29 @@
       expect(menu.slider()._slider.style.height).toEqual('60%');
     });
 
+    it('should correctly resize on prefixing', function () {
+      var menu = KorAP.OwnMenu.create(demolonglist);
+      menu._firstActive = true;
+      menu.limit(3);
+
+      expect(menu.show()).toBe(true);
+      expect(menu.slider().offset()).toEqual(0);
+      expect(menu.slider().length()).toEqual(9);
+
+      expect(menu.prefix("e").show()).toBe(true);
+      expect(menu.slider().length()).toEqual(6);
+
+      expect(menu.prefix("el").show()).toBe(true);
+      expect(menu.slider().length()).toEqual(2);
+
+      expect(menu.prefix("e").show()).toBe(true);
+      expect(menu.slider().length()).toEqual(6);
+
+      expect(menu.prefix("").show()).toBe(true);
+      expect(menu.slider().length()).toEqual(9);
+    });
+
+
     it('should correctly move the list on mousemove', function () {
       var list = [
 	["Constituency"],
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index abe2a15..b600833 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -5,11 +5,9 @@
  */
 /*
  * TODO: space is not a valid prefix!
- * TODO: What is _pos and what is position?
- * TODO: What is the difference between position
- *       and _active?
  * TODO: Ignore keys with function key combinations (other than shift)
  * TODO: Show the slider briefly on move (whenever screen is called).
+ * TODO: Optimize scrolling to active item.
  */
 define([
   'menu/item',
@@ -132,8 +130,6 @@
       this._slider.length(this.liveLength());
       this._slider.limit(this._limit);
 
-      this.position = 0;  // position in the active list
-      this._active  = -1; // active item in the item list
       this._firstActive = false; // Show the first item active always?
       this._reset();
       return this;
@@ -158,11 +154,14 @@
       if (this.prefix().length <= 0) {
 
 	// add all items to the list and lowlight
-	for (var i = 0; i < this._items.length; i++) {
+	var i = 0;
+	for (; i < this._items.length; i++) {
 	  this._list.push(i);
 	  this._items[i].lowlight();
 	};
 
+	this._slider.length(i);
+
 	return true;
       };
 
@@ -371,7 +370,8 @@
 
 
     /**
-     * Filter the list and make it visible
+     * Filter the list and make it visible.
+     * This is always called once the prefix changes.
      *
      * @param {string} Prefix for filtering the list
      */
@@ -415,12 +415,10 @@
 	};
 
 	this.position = active;
-	this._active = active;
       }
 
       else if (this._firstActive) {
 	this.position = 0;
-	this._active = 0;
       }
 
       else {
@@ -445,8 +443,11 @@
       //this._slider.show();
 
       // Iterate to the active item
-      if (this._active !== -1 && !this._prefix.isSet()) {
-	while (this._list[this.position] < this._active) {
+      if (this.position !== -1 && !this._prefix.isSet()) {
+
+	// TODO: OPTIMIZE
+
+	while (this._list[this.position] < this.position) {
 
 	  // TODO. Improve this by moving using screen!
 	  this.next();
@@ -595,7 +596,6 @@
       };
 
       this.position++;
-      this._active = this.position;
 
       newItem = this.liveItem(this.position);
 
@@ -609,13 +609,11 @@
 	if (prefix.isSet() && !prefix.active()) {
 	  this.position--;
 	  prefix.active(true);
-	  this._active = -1;
 	  return;
 	}
 	else {
 	  this.position = 0;
 	  newItem = this.liveItem(0);
-	  this._active = 0;
 	  this._showItems(0);
 	};
       }
@@ -725,7 +723,7 @@
     // Reset chosen item and prefix
     _reset : function () {
       this._offset = 0;
-      this._pos    = 0;
+      this.position = 0;
       this._prefix.clear();
     },
 
