Fix compile errors on mac