Fixed handling of namespaces