Fixed caching bug that occurs with empty cache