Some javascript fixes