Fixes issue #998.

Fixes multiple issues with the way PR #997 was implemented. 
@TShapinsky this was moved in the `watchdog` callback object since it's the only one making use of it.