Add some unit tests, fix bug in paramSet::getDist