Fixed bug in TreeDensity.