Fixed macosx builds, taking pr #462 as reference

this should better fix macosx build failures