added more informative error messages when invalid parameter count
Merge pull request #1082 from scotam/invalid-parameter-count

added more informative error messages when invalid parameter count