Fix using global templates; fix namespacing issues.