Fix primitive generation.