Fix off-by-one indexing, use correct date in msg

Also make compare function work if a[attr] > b[attr]