rebuild indexes correctly in repairdb