Only add namespaces when needed.