Merge "Build target path before closedir()." into nyc-dev