Fixed and added some test cases to very basic handling of command line options.

Check-in [09b4f19f10].