Fixes for osx.