Fix some atrocious coding in chat-plugins.js