fixed some bugs in the ret op call impl and typechecking