Fixed undo stack.