Fixed js errors with plugins