Fix bugs with plugins