There is an issue with the userservice since it was patched to add non existant groups when creating a new user. For existing groups with a new user it resets the group sharing settings, it does not do this when updating a user. I am not sure how I need to attach my corrections so I have attached a patch file that should give an idea of what needs to be changed.
Please let me know if there is anything wrong with my patch file.