Fixes endnote export functionality and adds a test