Merge return_distance tests of both linkage and ward tree