minor javascript fixes