Base and step now stop at flags.bmc_max.

Base was already stopping at bmc_max, moved the check before looping.
Step was not, it now does stop. The check is also before looping to the next k.