Changed how the targetDir is created.