Fix by_index