Fix undefined variable name
Fix exception messages and undefined var name
Merge pull request #95 from zupert/master

Fixed some variable declarations and exception messages