Fixed Javascript and HTML errors