Fixes #811. Fixes reflinks
Merge pull request #821 from 3lnc/Document.switch_docstring_fix

Fixes #811. Fixes reflinks