Fixes to the job monitoring system.

Fixing this is kind of difficult since I don't have any working example to study.

cc @rexissimus