Issue #3678: Remove wrappers and call foreign functions directly