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