Fixed problem where cross-validation fails if only one class is in the training set