Properly apply templates to export opts
Fix export opts tests
Formatting