Pull document ID fixes:

* Implement PR feedback
* Remove unused variables and fix comments