Corrected bug in random identifier generation