Fix temporary directories not being created before files being copied
into it