Type check foreign calls