Fixes to work in appliactions using interpreted templates