code changes to fixe compile errors on mac