fix compile bugs in mac clang++ compiler.