Fix use of namespaces in instance creation