Ranking/repair script fix