Fixed hasNamespace check (hopefully)