Changed calculation of end timestamp