Fixed namespace issues and updated tests