Fixes ClassCastException when DashboardWidget java classes are removed and instances are still saved on the Dashboard.