Fixed some compile errors on osx.