Fixes incorrect truncation
Merge pull request #3811 from twokul/fix-for-set-path

Fixes incorrect truncation