bug fixes and namespaces fixes