Fix a bug where notifications could unexpectedly be cleared