Cleaned up validation and options.
Merged from upstream.
Merge pull request #220 from arb/update-validation

Cleaned up validation and options.