Fixed tricky bug with invalidating widget-class level struct template cache in situation when there is inheritance between widgets with the same class name.
BTW changed inheritance detection condition to the more reliable.