fixed bugs and add comment to Document.
 Please enter the commit message for your changes. Lines starting