Bugfixes to ensemble.similarity()