Fix jshint warnings
Add simple test case