Fixed bugs in primitive injection/conversion