Template caching fix