Fixed a couple javascript bugs that I introduced