bugfix: DistanceForMatrix had slice indices swapped
added package test