Fix expiry checking