Fix uid generation