Remove unnecessary global
Fix issue with links for attachments and their parents not working correctly. Fixes #82