Only perform repair if necessary.