fix some whitespace and javascript syntax problems