Fixes for OSX and Windows.