Fixed bug with caching.