Some more fixes for UndoStack