Correct handling of undo-redo list which is detachable.