Update undo and redo stacks on initialization.