Fix improper regex matching for namespaces

Fixes #6