Backport issue #797 to 1.3.0: support nested paths