Bug fix while running distance tests.