Added tests for widgets and logic for clearing base classes.