Fix path escaping with path depth limitation.

cc @buchi