fix hanging open bracket, and some jshint issues