compile fixes for Clang/Mac