Fixes to Document Views

Fixes to Document Views
Linked to the first comment, which could be the case where at this point the document is still None?