Fix psql problem when updating alert cache data
Fix processing of alerts
Use correct record numbers when sending daily alerts