Fix some issues with the OSX port