Fixed js so that it can be minified