Fixed some js errors