Fix tests, add end_time