Repair some problems