Changed the way the directory name is set and built.