Fix isTripInPeriod