Fixed infinite loop by reading what ret_next_instruction_idx does