Bugfix in the endtime calculations