Fix javascript stuff for plugins