Exporter fixes and better coverage

Partially fixes #2491.