Fix persistent undo not work issue.