Added .jshintrc and fixed a few bugs