Made the rename block use newDirectory instead of Path.GetDirectoryName in all instances