fix call and ret bugs, added d_valp implementation