namespace and compatibility fixes
coding style