fix for #122 jshint warnings
#122 fix all jshint warnings
fix error throwing order
Merge pull request #125 from StDako/master

fix for #122 jshint warnings