Fixing undo/redo re-rendering behavior