Fixed some issues related to handling external function calls.