The error correction of save file

Hello All,
I make a Topods_Wire has small ring and use it build Topods_Face.

When I save this model as STEP file, I found save file can correct the error of model.
The functions delete the small ring and use a new fit point replace that small ring.
If save as IGES file,it has different error correction results to STEP file.

Can you tell me which place realize the error correction in code?