Fix plugin iteration bug