Wrap the document, and handle null
Merge pull request #132 from jakemac53/patch-1

Wrap the document, and handle null