mac port and fixes