Fix 2 crash bugs

1. Unhandled error (eg bad hostname) ( #3  )
2. Un-cancelled watchdog on error