Improvements to chat plugin preventing server crashes