Fixing a few problems and updating .js files
Fixing some bugs