Fixed implementation of copyFileContent.