Fixed cache logic so download data is correctly available.