fix jshint and test cases