Fix macosx compile errors