Fix usage of StringBuilder when getting parent path