Fixed unexpired and expired scopes for notifications and added scope tests.