Fixed a bug in unionfind.sets() where the set trees were incorrectly assumed to be flat.