Fix a bug when getting namespaces