Fixes for OSX plugin build