Fix bug in pruning.