Fixes for OSX.