Fix bug when parsing nested types in namespaces

Fixes a bug when parsing nested types in namespaces