Undo works correctly, small cleanup