Fixed minor bugs in the js and html