Fix wrong index and adding search-insert-position