Fix bug where program breaks if cache is absent