Fixed logic predicting next due sync and last sync dates