Fixed a bug in relative date math