Fix a bug in cache access