fixed g++ compile issues