Fix another logic error with adding unique step IDs