Fixed caching and logging