Fixed bug which was incorrectly setting max_end_date.