Die if invalid reference
Factor out command line generation
Line length
Die if invalid methratio version
Typo