Added limit to template instantiation recursion depth.