Bugfix Smart error handler

Bugfix for cases of null reports and also
a few cases where jobs could get stuck in jobfailed.