Made parsing more flexible, improved error reporting.

Now you can put a single date where an array is wanted,
or even a single number.  Similarly with agents.