Only activate the event handlers if in debug.