Improved notification handling.
Improved handling if wifi is disconnected.