Fixes for Clang/OS X build