Fix regression in substitution.

- Update substitution to handle builtin funtions. This was
  a change from the previous implementation of intrinsics.