More fixes to build on mac os