Final fixes for macx build