Use require-resolve in update-in for function.

Fixes #1728.
Merge remote-tracking branch 'upstream/master'