Various fixes and improvements to how plugins are set