Use require-resolve in update-in for function.

Fixes #1728.