Fix some bugs and add a function to reset the sync date

Sorry, I got some formatting issues.