Fix repair to actually do stuff due to integer division