Fixed fallback in template cache when in debug mode