Fixed a possible problem at the generation of unique code values