Fix UndoGroupOptimizer