Fix SID generation.