Minor fixes in plugin handling