Fix bug where search index starts at 1 instead of 0