Already spotted that.
Fixed (typo

Out of curiosity why do you need to go to such lengths? This is normally something that I would expect to be dealt with at server level.
It was not part of the specification, nor a requirement, for this extension.
The person who required this extension.
If everything is working OK then I would delete those duplicates via ACP after having made a backup of the database first. (I know from experience that getting this wrong is not the easiest to recover from!)