fix produce_reg
fixes