Improved code style and fixed javascript file.