Fix small bug in cache