Catch everything.
Add possibility to dump some statistics from completed task.