Bugfix in dashboard, and tests to aid coverage