Fixed bug in copyFileContent where an existing file was not being recreated.