Fixing mistakes in javascript, removing unused

* making sure minified version loads