Undo/redo now works cleanly.