Some JS fixes

![l14](https://f.cloud.github.com/assets/873432/796694/bb99cde8-ed2c-11e2-9a1c-b00eef84c69f.png)