Fixing precise date calculations