fixed typo in error handling code; added tests for bad input
Merge pull request #1 from peterkhayes/master

fixed typo in error handling code; added tests for bad input