Fixed several bugs in wdt.py to finally get the watchdog to work