Fix an undo bug.