fix errors because python's date handling sucks