Fix some js errors