Fix ext function plugin env binding

Closes #1138