Fixed js errors