Fix crasher when reloading plugins