Fix macosx errors