Fix ref bug in plugin loader test