Added some error handling to avoid program to terminate abruptely with node guts all over the floor.
Fixing jshint errors
Version bump to v1.1.2
Merge branch 'hotfix/v1.1.2'