Fixed a typo in cache.py and ran some tests

Still behaving strangely.  Not sure why.