Don't smother the error. Log to stderr.
Parameter validation tweaks and associated tests.
Merge pull request #1 from alanshaw/master

Parameter validation and error logging