fix compile errors on OSX