Improve duration validation.