Must fix generateFile function.