Added logging and corrected cache eviction behavior