Fix a crash due to the wrong variable being used when building a directory string.