Fixed NullPointer exceptions when cleaning notifications and courses on
preferences change