Fixed document edit, and other minor issues in the document task.