Fix bad Javascript