Tweaked the generateUID method a bit. Also corrected a typo.