Fixed bug with new documents.