Minor fixes

 * Added jsdoc
 * Add missing space to error message
Merge pull request #24 from golyshevd/refactor

Minor fixes