Made undo work.