Fix bug in alerting.