Small javascript syntax fixes