Fixed a bug inside matrix distance factory
Fixed a bug inside matrixDistances class.