Fix bug where bad program flow caused multiple notifications to be sent.