Fix wait instruction to be able to read wait variable from a register.