fixed g++ build errors