Fix build issues in mac