That appears to clean up the file, however I'm still getting corrupt files (1Kb compared to 23Kb as expected). After removing all my code I got:
$phpdocx = new CreateDocx();
$phpdocx->addTemplate('template.docx');
$phpdocx->createDocxAndDownload("test.docx");
and still got a corrupt file. I'm using Word 2010 on Windows 7 (if that helps). Any insight would be greatly appreciated. Thanks.