Fix bug in cache.put