Template caching and redirects fix