fix mac / os x related build errors