Some better cleanup and error handling.
Add "metavars" to usage.