Fix caching of values