Improve style, fix some javascript bugs