Change order of num_steps checking condition.