Fixing infinite undo stack, fixing undo/redo functions, fixing GUI update when renaming an element