Fix iOS and OSX build