Changes to automatically remove the widgetname class when a widget is destroyed