Adding a fix to handle NPE on several classes related with alarms.