fixed compile errors for osx