AI-499 : fixed undo/redo issues :
1) widget should reference on itself (not on inner widget);
2) add/remove via local variables.