Changes to allow building on TARGET_OSX