Added test and cleaned up for jshint