Fixed the bugs for indirect invoke