fixed bug for index_of() / index_nearest()