Better undo handling.