#183 Create document links - unit tests and fixes