Fixed flush-caches to work when there is no cache