Fix some fatal crashes
Tasks are now started and stopped when wifi is enabled or disabled