Fix day function when called repeatedly while waiting for data (eg. on startup)
Add tests and fix backward compability with old server