Fixed checking of date expiration.