Fixed compile errors on mac