Multiple links to one document, fix sql tuple error