bugfix for a case when similar classnames may lead to false +ve when
pruning

and some other minor updates.