Make sure max_time is not too large.