Template and location fixes, caching