Fix sid generation.