[#890] Fixes for template extends