Added debug option to flush-caches