fix g++ build and tests