Fixed google closure compiling and some js syntax errors.