Close the document when done.

Change-Id: Iad20ac5533a46a74642093c686e0941fb3bd29e3