Corrected bug on VDocument.writeDocument