Use KV's get_index_n

Use the KV version of `get_index_n`.