Fix negative values in alarms.

All alarm-related methods were operating on unsigned integers instead of
signed integers.