Fixed consistency issues in cache