Onnx export v2 fixes
Tiny fixes. To see just the fixes, check the first commit's changes.

The second commit addresses code quality issues.

Remaining TODOs before merging:
- Add a test for all supported architectures
- Write a small Usage doc