Fix expiration calculation.