Fix template cache compiler bugs
Merge branch 'fix-compiler'