Fixed find_index with 0 length