Fix various crashes with pluginpref