Fixed an error in pruneFinishedBags function. Resulted in pruning best bags.