Hotfix for bug in cache.

* Lists shrink if last non-void entry is deleted.
* Even if no key is deleted, keys need to be sanitized in cleanup.
  This needs to be done more general.