Better handling of the expiration date.

LMS-1127