Fix infinite recursion bug in cache.

- Fix an infinite recursion bug in the cache.
- Adjust indentation in list comprehension.
Merge pull request #50 from dlebech/master

Fix infinite recursion bug in cache.