Fixed issue where end dates were being calculated incorrectly.