Fixed bug in get_document_content_to_file method.