set_registers must pass the correct reference

The previous implementation was wrong.