Fixed alarm bug in agent.