Fix code generation for some primitives that take a reporter block