Fix expiry

Fix (and re-enable) device expiry.