Fix 2 bugs in the index, closes #4, closes #5