Bug fix for retainClasses with unlabeled data