Bugfix Smart error handler

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