Fix the generation of folders