std::max takes a double, not a DistanceType

Fixes a build problem on Mac OS X