Ticket #1041: Fixed broken notifications code after refactoring