Properly handle empty namespaces