Fixed bug with external function calls.