Fixed warnings and build errors for mac/clang.