Fix range issue for partrepair.