It was effectively sqrt(max_distance) before this fix. Thanks to Omar Emara for identifying the solution.