Cleaned up command-line parsing.

Fixes #68