Fixes for OSX builds.