Fix bug with overwriting cache entry.