Fixed a bug in reading average distance for sammon mode