Fix caching to not treat an empty array as a cache miss.