fixes bugs in tests and a minor revision of logsumexp

Several fixes:
- use ``Base.Test`` instead of ``Test``
- the ``distances`` function computes distances between columns, but the original test script seems to consider it in row-wise way
- the logsumexp does not actually use ``a_min``. I remove the unnecessary computation there.