fixed minor flaw in average distance calculation
Merge branch 'fix-average-clustering'