Implemented namespaces and fixed tests