transfered changes from cloud-user-sync-fixes because that branch was ma...

...de form master