UndoManager improvements