Fix argument checking.
Merge pull request #3 from square/scottb/errors

Fix argument checking.