Fixed bug in enabling/disabling caching.