[core] Fix uid generation