Only define namespaces if they have not already been defined. Fixes #1.