Large number of changes to fix notifications and make the app more reliable.