fixes to make easier to compile on max os x.