Fix caching of textures.