Fix a problem with document init during project instance creation.
Fix some problems when a document is approved.