Fixed bug in getting leader for watchdog.