fix some bugs in JSReporter2 introduced in previous commit