Cleanup, error handling. Remove old notifications to prevent memory leaks

Sam Clark requested to merge dev into master

Merge request reports