JS fixes

Jen looked over the JS code and suggested a bunch of fixes. Thanks Jen!