Fixed compile errors on OSX.