Add support for foreign calls