You need to tell the document its "owning" structure, you shouldn't
need to actually attach it to a structure:

   aDocument owner: aStructure

Thanks Lukas, that was a simple fix. 

I've found a few problems in the link parsing, which I've fixed - so it seems good to go.