Bugfix: clearNotifications

clearNotifications is sometimes invoked without an alarm object. On those occurrences, alarm.name is undefined. This makes the alarm object optional and checks whether alarm is there before checking alarm.name.