Fix build_index err.