Added protection for scalate templates