Fix alarm tick count startup.
Adding support for periodic activities.