Fix compile errors on osx