Fix bugs caused by misunderstanding pseudo-code

Algorithm should not end when best attribute cannot split the partition.