fixed some bugs in sys_apply/vm_call