Thanks David and Zdenek,
I think I fixed it, adding a check for not deleted users.
Pull the last commit on github to get it.
I'll made some tests to check if I need to add an orphan records discover procedure before publish a new release on moodle.org.
Cheers,
Roberto