Fix the generation of events for primitive types