Please compare these changes and let me know if you believe they're reasonable

I've changed some javascript and some html to fix errors. More changes to come.