Merge pull request #174 from rrthomas/master

Improve command-line handling