I would check here that the pins aren't set to zero too.  Basically if the pin is assigned we should measure it and use for alarm.  If not asigned set to zero (or unchanged if it initializes to zero)