Repair broken logic