Small js improvements