Fixes for building on mac.