Fixing jshint, removing unused code