Fix bug on clearing cache.