Make CopyPathToPath work with directories