Fix random id generator