Fixed osx compile errors