History database FIXED!!! (older data now works)
The problem was the distinction between:

"Last minute of the day"
      compared to
"how many minute are in a day"

These are not the same concept.

Last minute starts 60 seconds before midnight
They are numbered 0 to 1439, total is still 1440

This bug is related to an "off by one" error
I was really glad to see it was so easy to fix :)