Fixed a bug in the caching code that meant that the cache never had any
data added to it.