Fix repair bug