Fixed jshint errors and formatting