Fixed bug when user skips set parameters:
In this case the minimum number of training files could exceed the actual
number of files available.