The class name should not be in the step file name
The code is using the number of files which start with the prefix
step. Since HabitatSampler uses the habitat name in the filename, and habitats are not always classified in the same order, we end up with many files of the same prefix. For example:
step_01_heather_old.tif step_01_heather_shrub.tif step_01_heather_young.tif
plot_results uses the number of files with prefix
step_ to know how many classes exist. That will lead to a crash.