Fixed some document / rich_document issues in repo.