Directories are now created before setting permissions on them.