Fix foreign function as first-class values